Simple Object Oriented project (Class creation) in Raptor
Budget: $45 – $70 USD
To be completed by Monday April 25th at 4PM
Task 1:
Save your files as <SiglerTask1>. Make sure your file has your first and last name as well as the date included as a header.
Complete the following tasks:
a) Create a class named Apartment that includes an apartment number, number of bedrooms, number of baths, and monthly rent. Include two overloaded constructors. The default constructor sets each field to 0. The non-default constructor accepts four parameters—one for each field. Include two overloaded display() methods. The parameterless version displays all the Apartment details. The second version accepts a value that represents a maximum rent and displays the Apartment details only if the Apartment’s rent is no greater than the parameter.
b) Create an application that instantiates several Apartment objects and demonstrates all the methods.
Task 2:
Save your files as <SiglerTask2>. Make sure your file has your first and last name as well as the date included as a header.
Complete the following tasks:
a) Design a class named Book that holds a stock number, author, title, price, and number of pages. Include methods to set and get the values for each data field. Also include a displayInfo() method that displays each of the Book’s data fields with explanations.
b) Design a class named TextBook that is a child class of Book. Include a new data field for the grade level of the book. Override the Book class displayInfo() method to accommodate the new grade-level field.
Task 3:
Save your files as <SiglerTask3>. Make sure your file has your first and last name as well as the date included as a header.
Complete the following tasks:
a) Design a class named Player that holds a player number and name for a sports team participant. Include methods to set the values for each data field and output the values for each data field.
b) Design two classes named BaseballPlayer and BasketballPlayer that are child classes of Player. Include a new data field in each class for the player’s position. Include an additional field in the BaseballPlayer class for batting average. Include a new field in the BasketballPlayer class for free-throw percentage. Override the Player class methods that set and output the data so that you accommodate the new fields.
Task 1:
Save your files as <SiglerTask1>. Make sure your file has your first and last name as well as the date included as a header.
Complete the following tasks:
a) Create a class named Apartment that includes an apartment number, number of bedrooms, number of baths, and monthly rent. Include two overloaded constructors. The default constructor sets each field to 0. The non-default constructor accepts four parameters—one for each field. Include two overloaded display() methods. The parameterless version displays all the Apartment details. The second version accepts a value that represents a maximum rent and displays the Apartment details only if the Apartment’s rent is no greater than the parameter.
b) Create an application that instantiates several Apartment objects and demonstrates all the methods.
Task 2:
Save your files as <SiglerTask2>. Make sure your file has your first and last name as well as the date included as a header.
Complete the following tasks:
a) Design a class named Book that holds a stock number, author, title, price, and number of pages. Include methods to set and get the values for each data field. Also include a displayInfo() method that displays each of the Book’s data fields with explanations.
b) Design a class named TextBook that is a child class of Book. Include a new data field for the grade level of the book. Override the Book class displayInfo() method to accommodate the new grade-level field.
Task 3:
Save your files as <SiglerTask3>. Make sure your file has your first and last name as well as the date included as a header.
Complete the following tasks:
a) Design a class named Player that holds a player number and name for a sports team participant. Include methods to set the values for each data field and output the values for each data field.
b) Design two classes named BaseballPlayer and BasketballPlayer that are child classes of Player. Include a new data field in each class for the player’s position. Include an additional field in the BaseballPlayer class for batting average. Include a new field in the BasketballPlayer class for free-throw percentage. Override the Player class methods that set and output the data so that you accommodate the new fields.