Quiz #7 Study Guide
6 Pages

Quiz #7 Study Guide

Course Number: CSE 100, Fall 2007

College/University: ASU

Word Count: 704

Rating:

Document Preview

Object Oriented Programming Practice Questions CSE 100, Fall 2007 Arizona State University True/False Indicate whether the statement is true or false. ____ ____ ____ ____ ____ ____ 1. In C++, class is a reserved word and it defines only a data type. 2. The member variables of a class must be of the same type. 3. The member functions of a class must be public. 4. In a class, all function members are public and all...

Unformatted Document Excerpt
Coursehero >> Arizona >> ASU >> CSE 100

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.

Oriented Object Programming Practice Questions CSE 100, Fall 2007 Arizona State University True/False Indicate whether the statement is true or false. ____ ____ ____ ____ ____ ____ 1. In C++, class is a reserved word and it defines only a data type. 2. The member variables of a class must be of the same type. 3. The member functions of a class must be public. 4. In a class, all function members are public and all member variables are private. 5. A class and its members can be described graphically using Unified Modeling Language (UML) notation. 6. Given the declaration class myClass { public: void print(); //Output the value of x; MyClass(); private: int x; }; myClass myObject; The following statement is legal. myObject.x = 10; ____ 7. Given the declaration class myClass { public: void print(); //Output the value of x; MyClass(); private: int x; }; myClass myObject; The following statement is legal. myObject.print = 10; ____ ____ 8. The public members of a class must be declared before the private members. 9. The constructor with no parameters is called the default constructor. Multiple Choice Identify the choice that best completes the statement or answers the question. ____ 10. The components of a class are called the ____ of the class. a. elements c. objects b. members d. instances ____ 11. Suppose that you have the following UML class diagram of a class. clockType -hr: int -min: int -sec: int +setTime(int, int, int): void +getTime(int&, int&, int&) const: void +printTime() const: void +incrementSeconds(): int +incrementMinutes(): int +incrementHours(): int +equalTime(const clockType&) const: bool +clockType() +clockType(int, int, int) According to the UML class diagram, what is the number of private members of the class a. 0 c. 2 b. 1 d. 3 ____ 12. Suppose that you have the following UML class diagram of a class. clockType -hr: int -min: int -sec: int +setTime(int, int, int): void +getTime(int&, int&, int&) const: void +printTime() const: void +incrementSeconds(): int +incrementMinutes(): int +incrementHours(): int +equalTime(const clockType&) const: bool +clockType() +clockType(int, int, int) According to the UML class diagram, which function is public and doesn't return anything? a. incrementHours c. printTime b. equalTime d. None of these ____ 13. Suppose that you have the following UML class diagram of a class. clockType -hr: int -min: int -sec: int +setTime(int, int, int): void +getTime(int&, int&, int&) const: void +printTime() const: void +incrementSeconds(): +incrementMinutes(): int int +incrementHours(): int +equalTime(const clockType&) const: bool +clockType() +clockType(int, int, int) Which of the following would be a possible definition of the default constructor for the class. a. clockType() { setTime(0, 0, 0); } b. clockType::clockType() { setTime(0, 0, 0); } c. clockType(int x, int y, int z) { setTime(0, 0, 0); } d. clockType::clockType(int x, int y, int z) { setTime(0, 0, 0); } ____ 14. A ____ sign in front of a member name on the UML diagram indicates that this member is a private member. a. + c. # b. d. $ ____ 15. Consider the following class definition. class rectangleType { public: void setLengthWidth(double x, double y); //Postcondition: length = x; width = y; void print() const; //Output length and width; double area(); //Calculate and return the area of the rectangle; double perimeter(); //Calculate and return the parameter; rectangleType(); //Postcondition: length = 0; width = 0; rectangleType(double x, double y); //Postcondition: length = x; width = y; private: double length; double width; }; Which of the following class variable declarations is correct? a. rectangle rectangleType; b. class rectangleType rectangle; c. rectangleType rectangle; d. rectangle rectangleType.area; ____ 16. Consider the following class definition class circleType { public: void set(double r); //Postcondition: radius = r; void print(); //Output radius, area, and circumference. double area(); //Postcondition: Calculate and return area. double circumference(); //Postcondition: Calculate and return circumference. circleType(); //Postcondition: radius = 0; circleType(double r); //Postcondition: radius = r; private: double radius; }; and the declaration circleType myCircle; double r; Which of the following statements are valid in C++? (i) cin >> r; myCircle.area = 3.14 * r * r; cout << myCircle.area << endl; (ii) cin >> r; myCircle.set(r); cout << myCircle.area() << endl; a. Only (i) b. Only (ii) c. Both (i) and (ii) d. None of these ____ 17. In C++, the scope resolution operator is ____. a. : c. $ b. :: d. . Answer Section TRUE/FALSE 1. 2. 3. 4. 5. 6. 7. 8. 9. ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: Register to View AnswerF F F T F F F T REF: REF: REF: REF: REF: REF: REF: REF: REF: 651 651 653 653 653 | 654 654-656 654-656 670 672 MULTIPLE CHOICE 10. 11. 12. 13. 14. 15. 16. 17. ANS: ANS: ANS: ANS: ANS: ANS: ANS: Register to View AnswerD C B B C B B REF: REF: REF: REF: REF: REF: REF: REF: 650 654 653 | 654 653 | 674 654 654 | 655 654 | 655 660

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:

ASU - CSE - 100
1 CSE 100: Principles of Programming with C+ Department of Computer Science, Arizona State University Fall 2007, Quiz 5 20 Points, 20 Minutes Part I: Indicate whether the statement is true or false. Each question worth 1 point1. A user-defined valu
Centre College - HIST - 120
Vivian Richmond 04/12/08 HIS 120, Prof. Hamm Failure at Camp David In June of 2000, United States President Bill Clinton met with Israeli Prime Minister Ehud Barak and Palestinian Liberation Organization (PLO) chairman Yasir Arafat at Camp David. The
Centre College - HIST - 120
Vivian Richmond 1 Decalogue and the Law Posting the Ten Commandments (the Decalogue) in public schools and government buildings has been a hot issue for over a decade. Some say we need more moral guidance, and some say that separation between church
Hobart and William Smith Colleges - ECON - 160
Practice Problems for Test IVQ1 The Freedonian economy is characterized by the following information: C = 30 + 0.75(Y - T); I = 200; G = 250; T = 200; EX = 150; IM = 175. All figures are in billions of dollars/year. a. What is the value of the Simpl
Hobart and William Smith Colleges - ECON - 160
Chapter 7 Efficiency and Exchange Dead Weight Loss: Loss to both Supply and Demand due to government interference. The point is to Maximize Efficiency of goods/services used.Equilibrium Customer Sees:P 2.0 1.4 S Consumer Surplus Producer Surplu
Hobart and William Smith Colleges - ECON - 160
Lauren Nitahara October 23, 2005 p. 189 2. a) Weekly Shortage = $7 / Week b) Economic Surplus = $16.50 / Week 4. a) 4.5 b) c) Producer supply is not the same as profit. Producer supply is the amount of goods a producer has at any given time. Profit i
Hobart and William Smith Colleges - HIST - 320
Kennedy's Domestic Program30 March 2006 Reading: Once Kennedy was elected there was a tremendous sense of anticipation as he was preparing to take office. There was a sense that something dramatic was going to happen. Almost like a piece of theatre
Hobart and William Smith Colleges - HIST - 320
The 50's and 60's28 March 2006 Reading: In the fall of 1957, just as the Little Rock Crisis was occurring, an event took place that devastated the American national ego. On October 4, 1957, Sputnik I was launched by the Soviet Union. One month late
Hobart and William Smith Colleges - HIST - 320
Truman14 February 2006 Approach of 46 elections Assume Truman had no chance Democratic party was splitting o Truman Democratic o Henry Wallace Progressive Party o General Eisenhower favored for nomination o Assumed Eisenhower was a liberal Fall
Hobart and William Smith Colleges - HIST - 320
The Korean War and The Red Scare21 February 2006 Exam: Up to 2/9/06 Readings June 25, 1950 - Invasion of S. Korea by N. Korea Immediately taken to UN Soviets boycotting UN to protest American refusal to admit
Hobart and William Smith Colleges - HIST - 320
Marching Toward Tet: The Ordeal of Lyndon Johnson25 April 2006 Reading: Goodwin, LBJ and the American Dream, 251-368; John Kerry, &quot;Vietnam Veterans Against the War&quot;; Students for a Democratic Society, &quot;The War Must be Stopped&quot;; Robert McNamara, &quot;In
Hobart and William Smith Colleges - HIST - 320
Eisenhower's Foreign and Domestic Policies21 March 2006 Reading: Geneva Accords signed in late July 1954. This was a treaty ending the war between the Viet Minh, the Communist group led by Ho Chi Minh and the French. It stipulated that Vietnam would
Hobart and William Smith Colleges - HIST - 320
Eisenhower's Second Term23 March 2006 Reading: In 1956 there wasn't any doubt that Eisenhower would run for a second election, nor was there a doubt that Adlai Stevenson would be his opponent. There wasn't any democrat that wanted to run against Ike
Hobart and William Smith Colleges - HIST - 320
The Great Society20 April 2006 Reading: Goodwin, LBJ and the American Dream, 170-250 Lyndon B. Johnson, &quot;The Great Society&quot;; Bruce Schulman, &quot;Lyndon Baines Johnson and American Liberalism&quot; in Chafe and Sitkoff, History of Our Time Lyndon Johnso
Hobart and William Smith Colleges - MATH - 130
Lauren Nitahara Calculus Notes Chapter P2 Points of Intersection Definition: A point of intersection of the graph of two equations is a point that satisfies both equations. Ex: Find points of intersection for y = x3 4x y = -(x + 2)
Hobart and William Smith Colleges - HIST - 320
Kennedy's Foreign Policy30 March 2006 Reading: Was Kennedy militant or peace-minded? It's best to see him as a leader whose policy was undergoing constant change. There's no question that he entered office determined to win the Cold War. He was an
Hobart and William Smith Colleges - HIST - 320
Richard Nixon27 April 2006 Readings: Democratic nominee was Hubert Humphrey. The Republican candidate was Richard Nixon, remarkable for his persistence. He was on the center stage of American politics from 1948 to 1974. He was born in 1913 in the s
Hobart and William Smith Colleges - HIST - 320
China and Korea16 February 2006 Civil war in China coming to a conclusion Nationalists Jiang Jie Shi (Chaing-Kai-Shek) Communists Mao Zedung Began as a guerilla army By 1930s represented sizeable force We provided Nationalist aid to avoid C
Hobart and William Smith Colleges - HIST - 320
The Great Society20 April 2006 Reading: Goodwin, LBJ and the American Dream, 170-250 Lyndon B. Johnson, &quot;The Great Society&quot;; Bruce Schulman, &quot;Lyndon Baines Johnson and American Liberalism&quot; in Chafe and Sitkoff, History of Our Time Why did the US lo
Hobart and William Smith Colleges - HIST - 320
The Red Hunt2 March 2006 Loyalty Review Board (1950) Truman's loyalty program out of hand Every mail carrier questioned about loyalty Thousands of governmental employees fired arbitrarily without being told identity of accuser or charges against
Hobart and William Smith Colleges - HIST - 320
Eisenhower's Foreign Policy9 March 2006 Reading: He understood the limits of American power, and was after all a career military officer. Given his experience, he knew exactly what he could accomplish with our power in the world. Eisenhower's realis
Hobart and William Smith Colleges - HIST - 320
The United States Goes to War19 January 2006 Going into the 1930s. Strong feelings of Isolationism Versailles Treaty end of WWI Wanted to stay out of corrupt, old world Assumption that war had been outlawed by Kellogg-Briand Pact (August 1928)
Hobart and William Smith Colleges - HIST - 320
Crisis: The 1968 Election25 April 2006 Readings: &quot;The Port Huron Statement&quot;; &quot;The Sharon Statement&quot;; William H. Chafe, &quot;,Dump Johnson&quot;; William Jefferson Clinton, &quot;Letter to the Draftboard&quot;; &quot;You Dont Need a Weatherman&quot; in Chafe and Sitkoff, History
Hobart and William Smith Colleges - MATH - 130
Lauren Nitahara Calculus Notes Chapter P3 - Functions and their Graphs Definition: A relation between two sets X and Y is a set of ordered pairs each of the form (x,y) where x is in X and y is in Y. Ex: (red, apple) (yellow, banana) Definition: A fun
Hobart and William Smith Colleges - HIST - 320
All the Way with LBJ18 April 2006 Reading: Ambrose and Brinkley, 190-223 Goodwin, LBJ and the American Dream, foreward, 1-101 Johnson had spent most of his career in congress and knew exactly how it worked. The first thing he did was pass all major
Hobart and William Smith Colleges - HIST - 320
Causes of the Vietnam War4 April 2006 Reading: The Vienna Summit was in June 1961 when JFK met with Khruschev in Vienna, Austria. Khrauschev was worried about Kennedy's Inaugural address. He was worried by the huge American arms buildup and the int
Hobart and William Smith Colleges - MATH - 130
Lauren Nitahara Calculus Notes Chapter P1 What do we know about lines? - Slope: m = rise = y = y2 y1 run x x2 x1 - Two Points: x1 y1 x2 y2 - Equations of Lines: Slope-Intercept Form y = mx + b &lt; if given line Point-Slope Form y y1 = m (x x1) &lt; if
Hobart and William Smith Colleges - HIST - 320
Overview of the War24 January 2006 July 1941 Japan seized Indochina (Vietnam, Laos, Cambodia) Indochina important because of production of natural rubber Large portion owned by Michilin Company 1943 DuPont produced synthetic rubber using petroleum
Hobart and William Smith Colleges - HIST - 320
Domestic Policy and Politics in the Late 1940s9 February 2006 International Front Truman's policy grew much support for the most part Americans shifted to a Cold War frame of mind Domestic front Americans not satisfied Rapid Economic growth Fac
Hobart and William Smith Colleges - MATH - 130
Lauren Nitahara Calculus Notes Domain and Range of a Function Ex. Find the domain of f(x) = 1 . x-3 Domain: all allowable x's to go into f(x) Certainly x 3 0 so x 3 Also x 3 0 so x 3 Real Number Line: Interval Notation: Set Notation: (3, ) x 33x
Hobart and William Smith Colleges - HIST - 320
All the Way with LBJ18 April 2006 Reading: Ambrose and Brinkley, 190-223 Goodwin, LBJ and the American Dream, foreward, 1-101 Vietnam, 1964 The year Johnson wanted to lay low; running for election, wanted highest possible vote total, and was doing
Hobart and William Smith Colleges - HIST - 320
Isolationism and the 1930s17 January 2006 Unemployment and the Depression Estimated unemployment at 30-35% during the depression No unemployment insurance Normal unemployment at 5% National emergency when unemployment is at 10% Most employees h
Hobart and William Smith Colleges - MATH - 130
Lauren Nitahara Calculus Notes Chapter 1.1 SECANT LINE msec = f(c+x) f(c) x as x approaches zero * Read examples on pages 66-67 #1-2 Consider f(x) = x2 4 X+2 x f(x) -2.01 -4.01 -2.001 -4.001 -2 ? -1.999 -3.999 -1.99 -3.99 TANGENT LINE mtanWe'd li
Hobart and William Smith Colleges - ECON - 160
Chapter 9 Monopoly and Other Forms of Imperfect Competition Why study perfect competition? o This is the ideal market o Should compare other markets to this standardImperfect Competition Various forms of imperfect competition: Pure Monopoly (mo
Hobart and William Smith Colleges - ECON - 160
Chapter 8 The Quest for Profit and the Invisible Hand Efficiently functioning markets are self idling Smith discusses: o Price Mechanism o Profit Motive Self Interest Leads Market Forces automatically provides what market needs Firms want to
Hobart and William Smith Colleges - ECON - 160
Chapter 5 - Demand1. Law of Demand 2. Derive Demand Curve 3. Measure Consumer Benefits Law of Demand As price rises, people do less of it Thus slope usually decreases Even if it is &quot;free&quot; there is an opportunity cost involved Applies to all good
Hobart and William Smith Colleges - ECON - 160
Chapter 4 - Elasticity Price Elasticity of Demand: percentage change in quantity demanded that results from a 1 percent change in price Elastic: demand is elastic with respect to price if price elasticity of demand is greater than 1. Inelastic: d
Hobart and William Smith Colleges - ECON - 160
Chapter 1: Thinking like an EconomistSummary:Economics is the study of how people make choices under conditions of scarcity and the results of these choices for society. Economic analysis of human behavior begins with the assumption that people are
Hobart and William Smith Colleges - ECON - 160
Chapter 1 Thinking Like an Economist Scarcity Principle: Trade off between wants and limited resources * leads to Cost Benefit Principle The Cost-Benefit Principle: An individual should take an action if, and only if, the extra benefits from taking t
Hobart and William Smith Colleges - ECON - 160
Market Supply and Demand What to produce? For whom? How to produce? What price? Socialist Laissez-faireSweeden NorwayUS UKMost economies are mixed Why do we have this mix? o Too important to leave to people o Reasons of fairness, equity, etc. W
Hobart and William Smith Colleges - ECON - 160
Lauren Nitahara Econ 160 HW due 10/26/05 Chapter 9 #8-9 8. a) MR1 = 12 4Q MR2 = 8 6Q MR3 = 10 8Q b) MR1 = 2.5 MR2 = 2/3 MR3 = 1 9.PEquilibrium MR DMCQb) MR = 80 Q c) Equilibrium Price = $20 Equilibrium Quantity = 120 d) Profit = $3000 e)
Hobart and William Smith Colleges - ECON - 160
Lauren Nitahara Homework Due 9/28 Chapter 5 Page 137 #2,3,5-7,9 2. The marginal utility from the last swallowed bite at a restaurant should be equal or greater than the second to last bite. 3. OJ MU = 75 utils Coffee MU = 50 utils OJ cost = 25 cents/
Hobart and William Smith Colleges - HIST - 320
Notes2 May 2006 Readings: FINAL EXAM: Cumulative Ids, but at least half of the Ids come from last 1/3 of course choose 10 of 14, essay, will be available on Sunday from 2-4 pm or by email Nixon's foreign policy, general structure set up by Kissin
Hobart and William Smith Colleges - ECON - 160
Chapter 23Definitions:Money any asset that can be used in making purchases Money Supply Frictional reserve system a banking system in which bank reserves are less than deposits so that the reserve-deposit ratio is less than 100 percent. Reserve R
Hobart and William Smith Colleges - ECON - 160
Econ 160Ch18 GDP HomeworkName:_GDP (national income) accounts for 1990 Expenditures for consumer goods and services U.S. exports Government purchases of goods and services Social security taxes Net investment Indirect business taxes U.S. import
Rose-Hulman - CE - 320
Amount Material Finer Than 75mm SieveASTM C 117 Tim Boyer CM 442Pre-LabPurposeThe purpose is to provide a method of &quot;wet sieving&quot; which is more effective and complete than &quot;dry sieving&quot;. Although more effective, &quot;wet sieving&quot; is used in conjunc
Rose-Hulman - CE - 320
Bulk Specific Gravity and Density of NonAbsorptive Compacted Bituminous MixASTM D-2726 Tim Boyer CM 442Pre-LabPurposeThe purpose of this lab is to provide a standard method for determining the bulk specific gravity and density of specimens of c
Rose-Hulman - CE - 320
Quantitative Extraction of BitumenASTM D-2172 Tim Boyer CM 442Pre-LabPurposeThe purpose of this lab is to provide a standard method for determining bitumen in hot-mixed paving mixtures and pavement samples.EquipmentOven Pan Balance Hot Plate
Rose-Hulman - CE - 320
Asphalt Viscosity at High Temperatures with a Rotational ViscometerASTM D-4402 Tim Boyer CM 442Pre-LabPurposeThe purpose of this test is to provide a standardized method for determining the apparent viscosity of asphalt from 100F to 500F using
Rose-Hulman - CE - 320
Percent Air Voids in Bituminous Paving MixutresASTM D-3203 Tim Boyer CM 442Pre-LabPurposeThe purpose of this method is to provide a standard method of determining the percent air voids in compacted in compacted dense and open bituminous paving
Rose-Hulman - CE - 320
Specific Gravity of Fine AggregateASTM C-128 Tim Boyer CM 442Pre-LabPurposeThe purpose of this lab is to provide a standardized test method to measure the bulk specific gravity, a characteristic commonly considered when handling mixtures such a
Rose-Hulman - CE - 320
Sieve Analysis of Fine and Coarse AggregateASTM C 136 Tim Boyer CM 442Pre-LabPurposeThe purpose is to provide a standard method of determining the particle size distribution of various aggregate products. This would provide useful data for cont
Rose-Hulman - CE - 320
Making and Curing Concrete Test SpecimensASTM C-192 Tim Boyer CM 442Pre-LabPurposeThe purpose of this lab is to provide a standardized method for preparation of materials, mixing concrete, and making and curing concrete test specimens under lab
Rose-Hulman - CE - 320
Air Content of Freshly Mixed Concrete by the Pressure MethodASTM C-231 Tim Boyer CM 442Pre-LabPurposeThe purpose of this lab is provide a standard method of determining the air content from freshly mixed content, excluding air in voids of aggre
Rose-Hulman - CE - 320
Flexural Strength of ConcreteASTM C-78 Tim Boyer CM 442Pre-LabPurposeThis purpose of this experiment to provide a standardized method for determining the flexural strength of concrete beams.EquipmentTesting machine Loading ApparatusProcedu
Rose-Hulman - CE - 320
Static Modulus of Elasticity and Poisson's Ratio of Concrete in CompressionASTM C-469 Tim Boyer CM 442Pre-LabPurposeThe purpose of this test is to provide a standardized method of determining the stress to strain ratio value and the ratio of la
Rose-Hulman - CE - 320
Splitting Tensile Strength of Cylindrical ConcreteASTM C-496 Tim Boyer CM 442Pre-LabPurposeThe purpose of this lab is to provide a standard test method for determining the splitting tensile strength of cylindrical concrete specimensEquipment
Rose-Hulman - CE - 320
Percent Fractured Particles in Coarse AggregateASTM D-5821 Tm Boyer CM 442Pre-LabPurposeThe purpose of this lab is to establish a standardized test for determining the percentage of fractured particles so that certain mixes can be verified that
Rose-Hulman - CE - 320
Flat and Elongated ParticlesASTM D-4791 Tm Boyer CM 442Pre-LabPurposeThe purpose of this lab is to provide a standardized test to check the compliance with specifications that limit particles or to determine the relative shape characteristics o
Rose-Hulman - CE - 320
Air Content of Freshly Mixed ConcreteAASHTO T-199 Tim Boyer CM 442Pre-LabPurposeThe purpose of this lab is to provide a standard method of determining the air content in a given freshly mixed concrete sample by use of the Chace Indicator.Equi
Rose-Hulman - CE - 320
Slump of Hydraulic-Cement ConcreteASTM C-143 Tim Boyer CM 442Pre-LabPurposeThe purpose of this lab is to provide a standard method of determining the slump of hydraulic-cement concrete, either in the lab or in the fieldEquipmentMold made of