Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2018 Fall CIS 200 Lab 5 Class, Inheritance and UML Assignment date: October 10, 2018 Due: October 17, 2018 Program 1 The following is a
2018 Fall CIS 200 Lab 5 Class, Inheritance and UML Assignment date: October 10, 2018 Due: October 17, 2018 Program 1 The following is a specification of three classes: Class Vehicle: Attributes: Age, an integer The age of the vehicle Price, a float The price of the vehicle Behaviors: setAge () Vehicle) default constructor sets age-o, and price-o.o 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 Vehicle Class Car: Attributes An object of type Car has all the attributes of an object of type Vehicle Additionally, Cars have attributes that Vehicles do not: RaceCarStatus , a boolean-> true or false Behaviors An object of type Car has all the behaviors of an object of type Vehicle Additionally, Cars have behaviors that Vehicles do not: Car() default constructor sets RaceCarstatus-false setRaceCarStatus() Takes an boolean parameter, returns nothing getRaceCarStatus() Takes no parameters, returns the car's race car status End Class Car 2018 Fall CIS 200 Lab 5 Class, Inheritance and UML Assignment date: October 10, 2018 Due: October 17, 2018 Program 1 The following is a specification of three classes: Class Vehicle: Attributes: Age, an integer The age of the vehicle Price, a float The price of the vehicle Behaviors: setAge () Vehicle) default constructor sets age-o, and price-o.o 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 Vehicle Class Car: Attributes An object of type Car has all the attributes of an object of type Vehicle Additionally, Cars have attributes that Vehicles do not: RaceCarStatus , a boolean-> true or false Behaviors An object of type Car has all the behaviors of an object of type Vehicle Additionally, Cars have behaviors that Vehicles do not: Car() default constructor sets RaceCarstatus-false setRaceCarStatus() Takes an boolean parameter, returns nothing getRaceCarStatus() Takes no parameters, returns the car's race car status End Class Car
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