Question: All 3 pages are for Question 1, C++ Please and Thanks! Thumbs up for help and answers Question 1 (30 points) The following is a


Question 1 (30 points) The following is a specification of three classes Class Phone: Attributes: Age, an integer Price, a float The age of the vehicle The first name of the vehicle Behaviors: Phone default constructor sets age=0, and price=0.0 Phone (int a, float b) parameterized constructor, which sets agea, and price=b setage (3) Takes an integer parameter, returns nothing setPrice() Takes a float parameter, returns nothing getage() Takes no parameters, returns the vehicle's age getPrice () Takes no parameters, returns the vehicle's price End Class Phone Class IPhone: // It should be a derived class from Phone Attributes: in object of type IPhone has all the attributes of an object of type Phone Additionally, IPhone have attributes that Phone do not: Apple Id, an integer Behaviors: an object of type IPhone has all the behaviors of an object of type Phone additionally, IPhone have behaviors that Vehicles do not: IPhone) default constructor sets AppleID to O setippleID(int x) Takes an integer parameter, set Apple ID, and returns nothing gethppleIDO Takes no parameters, returns the IPhone's Apple ID End Class IPhone Class IPhonel2: // It should be a derived class from IPhone Attributes: An object of type IPhone 12 has all the abbributes of an object of type IPhone Additionally, IPhone12 has attributes that IPhone does not: Augmented Realitytatus, a boolean yes or no Behavior: An objees of type IPhone12 has all the behaviors of an object of Dype IPhone Additionally, IPhone12 has behaviors that IPhone does not: IPhone120) default constructor sess DieselTypeStatus=falne setugmented RealityStatus (boix) Takes a boolean parameter, set the status, and returns nothing geshuguentedRealitystatus() Takes no parameters, returns the IPhone 12' augmented reality type status End Phonel2 It would be a horrible waste of valuable programming time to redatine all of the functions in IPhone or IPhonel2 when many of them are already defined. This assignment is to reinforce the application of inheritance Requirements: Draw three UML class diagrams, one for each of the classes mentioned above Draw a generalization among the three class diagrams, showing the inheritance relationship 3.) Implement the three classes described earlier (Phone, IPhone and IPhone 12) and write a driver function (main) in order to test them. For the testing, write the following test code in your main(): Phone MI cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
