KOI is offering a new laptop rental service. You need to create an application to allow an IT person to create reservations for students. You will need to use classes and Lists. Create a program that will ask the student ID, Name, Rental Start Date and End Date. It will use Reservation class object to save these 4 parameters (using a constructor). Reservation object will then be added to a List. The class will also have a method to calculate the rental ($1 per day). The program will keep asking if more reservations need to be entered(Y/N). For each reservation it will create the object and save it in a list. Once all reservations have been entered it should display the reservation details including the rental cost for each reservation in a tabular format.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
KOI is offering a new laptop rental service. You need to create an application to allow an IT person to create reservations for students.
You will need to use classes and Lists. Create a program that will ask the student ID, Name, Rental Start Date and End Date. It will use Reservation class object to save these 4 parameters (using a constructor). Reservation object will then be added to a List. The class will also have a method to calculate the rental ($1 per day).
- The program will keep asking if more reservations need to be entered(Y/N).
- For each reservation it will create the object and save it in a list.
- Once all reservations have been entered it should display the reservation details including the rental cost for each reservation in a tabular format.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images