Question: In this question, you are asked to create a class called Phone that has separate double member data for screenSize, cameraMPs, cpuRate and int batteryLife.


In this question, you are asked to create a class called Phone that has separate double member data for screenSize, cameraMPs, cpuRate and int batteryLife. Add a member function readInformation(), which should read class attributes from the keyboard like the sample output. The final member function ComparePhoneTo(Phone other) should compare the phone to the given phone, deciding over which one to pick. The one with higher screenSize, cameraMPs, cpuRate and batteryLife should be picked. In a tie situation, you should favor the phone with higher batteryLife. Write a main() program PhonePicker which creates two Phone objects then calls readInformation() from them. Lastly, compares the first one to the second and prints the result. The Phone class should contain the following private attributes and public methods: Attributes: screenSize: double cameraMPs: double cpuRate: double batteryLife: int Methods: ComparePhoneTo(Phone Other): readInformation(): As well as getters and setters for all class attributes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
