Question: Subtask class Agency Define a class for the renting agency with name Agency with following members: 1. a private attribute profitPercent of type float for
Subtask class Agency Define a class for the renting agency with name Agency with following members: 1. a private attribute profitPercent of type float for the profit percentage of the agency for each rental 2. a private attribute profit of type float for the summed up profit of the agency. 3. two private pointer attributes with name head and last of type Schedule as pointers to the first and the last element of a list of schedules for all the vehicles of the agency 4. a public standard constructor initialising the percentage of the profit to 20%, the profit to 0.00 EUR and the two pointers to null pointers 5. a public method with name get_profit without parameter returning the value of the respective attribute 6. a public method with name set_profitPercentage with a float parameter without retum type assigning the value of the parameter to the respective attribute 7. a public method with name add with a pointer of type Vehicle as parameter without return type allocating a new object of type Schedule on heap for this vehicle and appending it at the end of the list. 8: a protected method with name searchFor with an integer parameter and a pointer of type Schedule as return type searching in the list of schedules for the vehicle with the number given by the parameter and returning it 9. a public method with name is Free with a first integer parameter for a vehicle number, a date of type DayOfYear as second parameter as start day of a planned rental, an integer number of days as third parameter, how long the rental is planned, and a Boolen return type. The method shall check whether the vehicle will be free at the desired time period or not. Therefore send to the object of type Schedule, which is returned by the search function in the previous item, a message is Free and return its value. 10. a public method with name book with a first integer parameter for a vehicle number, a string for the customer as second parameter, a date of type DayOfYear as third parameter as start day of a planned rental, an integer number of days as forth parameter, how long the rental is planned, and a float as return type. The method shall book the vehicle for the customer. Therefore send to the object of type Schedule, which is returned by the search function in the previous item, a message book. Calculate the profit by the profit percentage and the returned price value and add it to profit Afterwards return the price 11. a public method with name chooseVehicle without parameter and an integer return type. In the body a list of the vehicles of all schedules shall be written onto standard character output stream, a vehicle number read from input and returned (see examples below). This functionality you can use later in function main in menue entry C Subtask class Agency Define a class for the renting agency with name Agency with following members: 1. a private attribute profitPercent of type float for the profit percentage of the agency for each rental 2. a private attribute profit of type float for the summed up profit of the agency. 3. two private pointer attributes with name head and last of type Schedule as pointers to the first and the last element of a list of schedules for all the vehicles of the agency 4. a public standard constructor initialising the percentage of the profit to 20%, the profit to 0.00 EUR and the two pointers to null pointers 5. a public method with name get_profit without parameter returning the value of the respective attribute 6. a public method with name set_profitPercentage with a float parameter without retum type assigning the value of the parameter to the respective attribute 7. a public method with name add with a pointer of type Vehicle as parameter without return type allocating a new object of type Schedule on heap for this vehicle and appending it at the end of the list. 8: a protected method with name searchFor with an integer parameter and a pointer of type Schedule as return type searching in the list of schedules for the vehicle with the number given by the parameter and returning it 9. a public method with name is Free with a first integer parameter for a vehicle number, a date of type DayOfYear as second parameter as start day of a planned rental, an integer number of days as third parameter, how long the rental is planned, and a Boolen return type. The method shall check whether the vehicle will be free at the desired time period or not. Therefore send to the object of type Schedule, which is returned by the search function in the previous item, a message is Free and return its value. 10. a public method with name book with a first integer parameter for a vehicle number, a string for the customer as second parameter, a date of type DayOfYear as third parameter as start day of a planned rental, an integer number of days as forth parameter, how long the rental is planned, and a float as return type. The method shall book the vehicle for the customer. Therefore send to the object of type Schedule, which is returned by the search function in the previous item, a message book. Calculate the profit by the profit percentage and the returned price value and add it to profit Afterwards return the price 11. a public method with name chooseVehicle without parameter and an integer return type. In the body a list of the vehicles of all schedules shall be written onto standard character output stream, a vehicle number read from input and returned (see examples below). This functionality you can use later in function main in menue entry C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
