Question
10. What is the value of register1.item_count, register1.total_price, register2.item_ count, and register2.total_price after these statements? CashRegister register1; register1.clear(); register1.add_item(0.90); register1.add_item(0.95); CashRegister register2; register2.clear(); register2.add_item(1.90); 11.
10. What is the value of register1.item_count, register1.total_price, register2.item_ count, and register2.total_price after these statements? CashRegister register1; register1.clear(); register1.add_item(0.90); register1.add_item(0.95); CashRegister register2; register2.clear(); register2.add_item(1.90);
11. What is wrong with this code segment? CashRegister register2; register2.clear(); register2.add_item(0.95); cout << register2.total_price << endl;
12. Consider a class Time that represents a point in time, such as 9 a.m. or 3:30 p.m. Give two different sets of data members that can be used for implementing the Time class.
13. Suppose the implementor of the Time class changes from one implementation strategy to another, keeping the public interface unchanged. What do the programmers who use the Time class need to do?
14. Consider a class Grade that represents a letter grade, such as A+ or B. Give two different sets of data members that can be used for implementing the Grade class.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started