Question: 1. In C++, is cin an object or a class? Is string an object or a class? 2. When using a string object, you do
1. In C++, is cin an object or a class? Is string an object or a class? 2. When using a string object, you do not know how it stores its characters. How can you access them? 3. Describe two possible ways in which a string object might store its characters. 4. Suppose the providers of your C++ compiler decide to change the way that a string object stores its characters, and they update the string member functions accordingly. Which parts of your code do you need to change when you get the new compiler? 5. What does the following code segment print? CashRegister reg; reg.clear(); reg.add_item(0.95); reg.add_item(0.95); cout << reg.get_count() << " " << reg.get_total() << endl; 6. What is wrong with the following code segment? CashRegister reg; reg.clear(); reg.add_item(0.95); cout << reg.get_amount_due() << endl; 7. Declare a member function get_dollars of the CashRegister class that yields the dollar value of the total amount of the sale. 8. Name two accessor member functions of the string class. 9. Is the get member function of the ifstream class an accessor or a mutator?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
