Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

Students also viewed these Databases questions

Question

Define organisational structure

Answered: 1 week ago

Question

Define line and staff authority

Answered: 1 week ago

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago

Question

* What is the importance of soil testing in civil engineering?

Answered: 1 week ago

Question

=+4 How did it affect HR?

Answered: 1 week ago