Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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