3 Pages

PreLab09-classes

Course: CSC 127a, Spring 2008
School: Arizona
Rating:
 
 
 
 
 

Word Count: 683

Document Preview

Section Name: Leader: Edward Leon Knapp Pre-Lab 09 CSC 127A Spring 2008 (15 points) Required Reading: Sections 7.1 7.7, 7.9, 7.10 Please read at least these sections of your text. Then answer the following questions and be prepared to turn them in at the beginning of your lab section on either 4/01 or 4/02. A word-processed write-up is preferred, but handwritten is acceptable as long as it is legible. You may...

Register Now

Unformatted Document Excerpt

Coursehero >> Arizona >> Arizona >> CSC 127a

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Section Name: Leader: Edward Leon Knapp Pre-Lab 09 CSC 127A Spring 2008 (15 points) Required Reading: Sections 7.1 7.7, 7.9, 7.10 Please read at least these sections of your text. Then answer the following questions and be prepared to turn them in at the beginning of your lab section on either 4/01 or 4/02. A word-processed write-up is preferred, but handwritten is acceptable as long as it is legible. You may NOT work with anyone else on this pre-lab. Topics: Defining a class, instance variables, writing class methods, writing constructors, access modifiers: public versus private, accessor and mutator methods, data manipulation methods, "this", toString and equals methods. 1. What is a Class definition composed of? A class definition normally is comprised with data that explains a person, place, or thing. The data of these classes are called fields. 2. What is the purpose of access modifiers? The purpose of an access modifier is to specify where the class or member of a class can be used. 3. What are instance variables? What code has access to them? The instance variables of a class hold the data for each object of that class. The code used to access instance variables is: accessModifier dataType indentifierList; 4. What is the general form of a method header (identify the parts that go into any method header and their purpose)? accessModifier returnType methodName ( parameter list ) 5. What is a constructor and how does it differ from a regular method? A constructor is a special method that is called when an object is instantiated using a new keyword. This is different from the regular method because it uses a different keyword and a different syntax. 6. Does a class definition have to include a constructor? Why or why not? It is not necessary for the class definition to have a constructor because the compiler will provide a default constructor when the program is compiled. Name: Section Leader: Edward Leon Knapp 7. A class can have more than one constructor why is this desirable? would How they differ? It is desirable to have more than one constructor because it allows the program to take in more information and provide more results. It is more useful to have more than one constructor because more can be completed with the program. 8. What is the difference between accessor and mutator methods? The difference between the two methods is that accessor methods return the instance variable and is very simple while the mutator method changes the instance variable. A noticeable difference in the programming is that the accessor method begins with an uppercase letter whereas the mutator starts with a lowercase letter. 9. Can code written inside a method access other methods in the same class? Why or why not? If the code is written inside a method, it can access other methods as long as it is in the same class. This is because they are made of the same fields so the data inside the classes should be the same. 10. How does code outside a class definition use the code in a class? The code outside a class definition can only use the code in a class if the method to do so is defined earlier in the program. The data type and fields would also have to be defined for the codes. 11. When do you need to use this? This is used when a variable is not specifically defined throughout the program. It is used in order to specify the object throughout the program. 12. Can you write code so you never need to use this? Explain why/why not. Yes, you can write a program so that you never have to `this.' In order to write a program like that every object would need to be defined every time throughout the program. 13. You can use the toString method on an object of a class without defining it - what does it return and is it useful? Yes you can use the toString method on an object of a class without defining it. Typically it will return a string representing the object's fields and takes no parameters. It is mainly only useful while using the System.out.println Name: Section Leader: Edward Leon Knapp
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Arizona - CSC - 127a
Name: Section Leader:Edward Leon KnappPre-Lab 04 CSC 127A Spring 2008 (10 points)1. What is null? When do you set objects equal to null? Null is the term for when an object reference is first declared, but hasn't been assigned to an object. Wh
Texas A&M - POLS - 206
TOPIC 3:FEDERALISMINTRODUCTIONA. Federalism is another way to divide power 1. 10th amendment: states coequal & independent. a. Powers not specifically granted to the federal government, or prohibited to all governments, is left to the states and t
Texas A&M - POLS - 206
TOPIC 1: PART 1THE PROMISE OF DEMOCRACYI. THE GENERAL NATURE OF DEMOCRACYA. Politics and Government 1. What Is Politics? a. Harold Lasswell (1938): "who gets what, when and how" b. David Easton (1953): "authoritative allocation of values" c. Both
Texas A&M - POLS - 206
TOPIC 2: PART 1THE AMERICAN CONSTITUTIONINTRODUCTIONA. The Constitution is a supremely political document B. Need to know what's in the Constitution II. DEFINITIONS A. What Is a Constitution in General? 1. Provides the basic rules & guidelines for
Texas A&M - POLS - 206
TOPIC 2: PART 2THE AMERICAN CONSTITUTIONIV. CHANGING THE CONSTITUTIONA. Formal Amendments-2-Step Process 1. Step 1- Propose Amendments a. 2/3rds vote in both houses of Congress. If some member of the House or Senate thinks the Constitution needs
Texas A&M - POLS - 206
TOPIC 1: PART 2THE PROMISE OF DEMOCRACYII. CONFLICTING VIEWS ON AMERICAN DEMOCRACYA. Populism 1. The populist model is probably the simplest. Direct democracy is a pure form of direct democracy. a. For example, the franchise (who has the right to
Texas A&M - POLS - 206
TOPIC 6: PART 2 POLITICAL PARTIESIII. STRENGTH OF POLITICAL PARTIESA. Party in the Electorate B. Party in Government C. Party OrganizationIV. PARTY COMPETITIONA. General Types of Party Systems 1. One party system a. Example: Mexico b. County lev
Texas A&M - POLS - 206
TOPIC 5 INTEREST GROUPS I. THE GENERAL NATURE OF INTEREST GROUPSA. Definition: A formal organization of persons who 1. Share common attitudes (or interest) on some matter and 2. Make demands on others in society to promote or protect that matter 3.
Texas A&M - POLS - 206
TOPIC 4:Civil Rights and LibertiesINTRODUCTIONA. Fundamental Questions 1. Liberty vs. social order; individual vs. govt. 2. Delicate balance 3. Ultimate test of the performance of democracy B. Political ConflictI.GENERAL NATURE OF CIVIL RIGHTS
Texas A&M - POLS - 206
TOPIC 6: PART 1 POLITICAL PARTIESI. THE GENERAL NATURE OF POLITICAL PARTIESA. Definition: An organization that nominates and runs candidates for office under its own label B. Differences between Political Parties and Interest Group 1. Method of inf
Texas A&M - POLS - 206
TOPIC 7PUBLIC OPINION AND PARTICIPATIONINTRODUCTIONA. What Do People Want Government to Do? 1. Popular sovereignty requires agreement between the wishes of the governed & actions of govt. 2. How do we find out what the people want? B. One Answer:
UCSD - BENG - 130, 103B,
BE103B Spring 2007Roadmap to Completing an External Convection ProblemIdentify whether problem is a heat or mass transfer one, or both.L. PengCylinderCrossflowUse table to obtain C and m based on Re. HeatCalculate: Examine geometry of ob
UCSD - BENG - 130, 103B,
Roadmap to Completing a Transient Heat Transfer ProblemExamine geometry of objectHas all finite surfacesNot enough info. to calculate Bi? Assume Bi < 0.1 and then verify afterwards.Bi < 0.1Find Bi =If Bi does not < 0.1, you can not use the L
Washington - EE - EE 341
Exam 2 ReviewEE 341 Discrete Time Linear SystemsFall 2007Howard Jay Chizeck University of Washington Seattle, WashingtonX(T) X(2T) X(3T) X(0)0T2TSignal xs(t) consists of a train of continuous time impulses-take off the arrow heads to ge
Washington - EE - EE 341
SamplingEE 341 Discrete Time Linear SystemsFall 2007Howard Jay Chizeck University of Washington Seattle, WashingtonRef: Text 5.4Linear Time Invariant Systems Sinusoid in yields a sinusoid out, at the same frequency, but with possibly differe
Washington - EE - EE 341
Discrete Time Systems and Digital Signal ProcessingEE 341 Discrete Time Linear SystemsFall 2007Howard Jay Chizeck University of Washington Seattle, WashingtonDigital Signal Processing (DSP) DSP is the representation of a signal by a sequence o
Washington - EE - EE 341
More About Regions of ConvergenceEE 341 Discrete Time Linear SystemsFall 2007Howard Jay Chizeck University of Washington Seattle, WashingtonFinite Length SignalsROCh[n]= [n] h[n] =0 for n< 0 Whole z plane Whole z plane except z=0 Whole z plan
Washington - EE - EE 341
Inverse Z Transforms and Solving Difference EquationsEE 341 Discrete Time Linear SystemsFall 2007Howard Jay Chizeck University of Washington Seattle, WashingtonRef: Text 11.6 ; In-class Ch 11 notes pp. 17-22Using Z Transforms To Solve Differe
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
NEIL J. DIAMANT POLITICS & SOCIETYMaking Love "Legible" in China: Politics and Society during the Enforcement of Civil Marriage Registration, 1950-66NEIL J. DIAMANTThis article looks at marriage registration as a window into state building and
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Dickinson - POLYSCI - 255
Wisconsin - ILS - 206
Wisconsin - ILS - 206
GWU - CHEM - 004
Chem 004 - Spring 2006AllergiesAntigens and allergens Most particles, dust, pollen, etc., are filtered by the hair and mucus in the nose and airways but, when present in a large number, some may pass into the lungs and even enter the bloodstream.
GWU - CHEM - 004
Chem 004 - Spring 2006Biochemistry: Chemistry of living things and life processes.Cell: structural unit of all living organisms. Cells are specific to the function of the particular tissue. Parts of the cell: Chemical composition, structure and fu
GWU - CHEM - 004
Chem 004 - Spring 2006Organic ChemistryChemistry of _ compoundsOf the more than 20 million known chemical compounds, over 95% are compounds of carbonWhy do we need to study organic chemistry?Organic Chemistry Plastics and Polymers Plastics
LSU - REL - 2000
REL 2000 Exam 3 Review Questions 1. How do the great synagogues of Judaism reflect the situation of Jews in different times and places? -Their size mostly has to do with the prosperity of the Jews and how much they get along with the people of the co
Clarkson - MA - 232
Clarkson - MA - 232
Clarkson - MA - 232
Clarkson - MA - 232
Rutgers - LING - 201
Rutgers - GEO - 101
Title Page PhotoPlate TectonicsVulcanismDiastrophism1 From Rigid Earth to Plate Tectonics Wegener's Continental Drift Fig. 14-1http:/geoweb.princeton.edu/courses/WebWhacker_2.0/WebWhacker_Database/WW171.html2Wegener's Theory based on
Rutgers - GEO - 101
Title Page PhotoComposition Study of Landforms Critical concepts Scale and Pattern1 The Composition of Earth (REVIEW) Minerals Common characteristics Solid Found in nature Inorganic Specific chemical composition Atoms arranged in a regul
Rutgers - GEO - 101
Title Page PhotoMovement of Ocean WaterPermanent IceSurface WatersUnderground Water1Movement of Ocean Waters2 types: 1. Surface Currents Mostly horizontal Primarily wind-driven Well-mixed Coriolis effect Affected by land masses Sit
Rutgers - GEO - 101
Modified Koeppen SystemThe basis is temperatures and precipitation amounts and patterns.Major Climate type: TropicalAfHumidity/precip Wet1 Severe Midlatitude Climates (Group D) Distribution of D Climates Northern Hemisphere only Within
Cal Poly - ENGR - 111
ReadingsChapter 6Stemplots Shows shape of distribution Indicates potential outliers Useful for displaying small datasets with positive values Displays original data Easy to construct by hand Displaying requires judgmentConstructing a St
Cal Poly - ENGR - 111
HomeworkDue: Wednesday, February 27 6.2, 6.4, 6.12, 6.14, 6.15, 6.18, 6.20Normal Distribution Symmetric Single peak Bell-shapedNormal Distribution1 f (x) = e " 2#% x$ ( 2 1 $ ' * 2& " )!Standard Normal DistributionMean = = 0 Sta
UCLA - CS - M51A
SPECIFICATION OF COMBINATIONAL SYSTEMSHigh-level and binary-level speci cations.1Representation of data elements (signal values) by binary variables (signals) and standard codes for positive integers and characters. Representation by switching f