Question
UML is required for this program. Make sure and ask for clarification if the directions are unclear. You're renting electric scooters. Create a class called
UML is required for this program. Make sure and ask for clarification if the directions are unclear. You're renting electric scooters. Create a class called Scooter that has the following attributes: Scooter name Rental rate Number of days to rent The class should have the following overloaded constructors: A constructor that takes the Scooters name, rate, and number of days. A default constructor that sets the Scooters name to blank, and the other values to zero. Write Get and Set methods for each attribute: name, price, number Do not allow number of days and rate to be less than zero Have a bill method that will return rate times number of days for the total price. Given the following Scooter offerings: Scooters name Price per day # of days Segway Ninebot 25.99 5 Xiaomi Mi 20.49 2 Gotrax GXL 16.97 4 Create the program ScooterTest that will create three objects for each row of the above table: first object must use the constructor for 3 values, second object must use the default constructor and the third object can use either constructor Use the set functions to fill in the information not set by the constructor(s), especially the number ordered. Print the values in the objects in a nice column format along with the total price. Hint: have another method to do all the printing and pass each Scooter object to that method -- makes the program easier to write. Create your UML for the class Scooter first and put it in the comments at the top of your program.
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