Given the following class: class person public: private: void setName (string); void setAge (int); string getName();...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Given the following class: class person public: private: void setName (string); void setAge (int); string getName(); int getAge() void print Person (): person (atring alame, int anAge); string name: int age: 31 // Clans Declaration //setAge, setllame, getAge, getName and person are implemented, but not shown Write the print Person function in the person class so that the output looks as the following xxxxx is an adult or xxxx is a teenager dr xoxox is a child where xoxx is the person object's name If the person is 20 years or older, then the person is an adult if the person is 13-19 years, then the person is a teenager otherwise the person is a child. Note: printferson() is a function inside the person class, it should be able to access all private members directly. Please don't forget out the scope resolution prefix before the function name, TTTT Para Given the following class: class person public: private: void setName (string); void setAge (int); string getName(); int getAge() void print Person (): person (atring alame, int anAge); string name: int age: 31 // Clans Declaration //setAge, setllame, getAge, getName and person are implemented, but not shown Write the print Person function in the person class so that the output looks as the following xxxxx is an adult or xxxx is a teenager dr xoxox is a child where xoxx is the person object's name If the person is 20 years or older, then the person is an adult if the person is 13-19 years, then the person is a teenager otherwise the person is a child. Note: printferson() is a function inside the person class, it should be able to access all private members directly. Please don't forget out the scope resolution prefix before the function name, TTTT Para
Expert Answer:
Answer rating: 100% (QA)
the implementation of the printPerson function in the per... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Public School Teacher Salaries, Class Size and Private School Markets: In exercise 14.10, we noted that private schools that charge tuition operate alongside public schools in U.S. cities. There is...
-
Is software engineering applicable when WebApps are built? If so, how might it be modified to accommodate the unique characteristics of WebApps?
-
Write a function that will return a full name string when passed a first name string, a middle name or initial string, and a last name string. If the middle initial is blank, there should be only one...
-
At one time the Thames River in England supported an abundant community of fish. Pollution then destroyed all the fish in a 40-mile stretch near its mouth for a 45-year period beginning in 1915....
-
Service-oriented architecture (SOA) is a recent approach to systems development and implementation that has much in common (and some differences, as well) with enterprise architecture. Go online and...
-
A 100 g ball on a 60-cm-long string is swung in a vertical circle about a point 200 cm above the floor. The tension in the string when the ball is at the very bottom of the circle is 5.0 N. A very...
-
What evidence is protected from disclosure based on a claim of privilege?
-
A New Yorker travels to New Jersey to buy a $100 telephone answering machine. The New Jersey Company that sells the machine then deposits the $100 check in its account at a New York bank. How would...
-
3) Using the consequence table from question 2, determine a preferred vehicle using even swaps and dominance (12 pts) Consider the following swaps to determine a preferred alternative (show all your...
-
Josie is an accounting supervisor at Monk & Sons Realty. She instructs her subordinate, Maria, to make certain accounting entries in the company's books that will increase revenue by a material...
-
Sudoku Company issues 7,000 shares of $7 par value common stock in exchange for land and a building. The land is valued at $45,000 and the building at $85,000. Prepare the journal entry to record...
-
1. What is the balance sheet date of Verizon's most recent year end? 2. Verizon rounds it financial statements to the nearest 3. Locate the income statement. Verizon calls this the Consolidated...
-
Optical receivers are widely used in Laser pointer, Time of Flight (TOF), and many other applications. Since detected light in sensor induces small current change, we need to change current signal to...
-
Describe how the different types of employees and payroll rates need to be considered when entering time sheets for employees.
-
1. Create a function that returns points on the Spirograph curve and plots the three shown spirographs Ring 150/105 and wheel 63 Ring 150/105 and wheel 52 Ring - 144/96 and wheel = 80 x(t) = (R-r)...
-
Has Ryan Services, Inc. underperformed or outperformed its competitors? On what dimensions? Show ratios please and analysis Comparative Financial Statements 1984-1985 (dollars in millions, except per...
-
17. The plan manager used the historical return for investing in long-dated government bonds (7%) as the expected return for fixed-income component of plan assets in his U.S. GAAP- reporting defined...
-
As long as we can't lose any money, we have a risk-free investment." Discuss this comment. Q2: Both investing and gambling can be defined as "undertaking risk in order to earn a profit." Explain how...
-
Modify the Student class in Listing 8.2 so that it implements the comparable interface. Define the compareTo method to order Student objects based on the value in studentNumber. In a main method...
-
Write a program that asks the user to enter a favorite color, a favorite food, a favorite animal, and the first name of a friend or relative. The program should then print the following two lines,...
-
Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating-point number for the temperature and a character for the scale: either 'C' for Celsius...
-
Which of the following statements regarding the audit of negotiable notes receivable is not correct? a. Confirmation from the debtor is an acceptable alternative to inspection. b. Physical inspection...
-
To conceal defalcations involving receivables, the auditor would expect an experienced bookkeeper to charge which of the following accounts? a. Sales returns. b. Miscellaneous income. c. Petty cash....
-
An auditor's risk of misstatement of accounts receivable is least likely to increase if there is a. An increase in customer complaints about their accounts. b. A general slowdown in cash collections....
Study smarter with the SolutionInn App