Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java program Objective build a complete working Java program that applies methods and basic object oriented programming Overview & Instruction Write a Java application that

image text in transcribed

image text in transcribed

java program

Objective build a complete working Java program that applies methods and basic object oriented programming Overview & Instruction Write a Java application that will manage a car rental transaction. To Your solution should include two files: one containing the CarRental class including the data and method definitions and a second file to contain the "driver" application. Build your solution such that all interaction with the user is contained within the driver application. Design your class to meet the following specifications Class CarRental Data Methods Customer classification Days vehicle rented Odometer mileage at start o No-argument constructor - Parameterized constructor o set/get methods . Odometer mileage at end Validate data . Calculate rental cost Your application should essentially do the following: 1. Read the input from the user via dialog-based input and "set" into one object of the CarRental class 2. Validate the input. If the information is invalid. Be sure to utilize the class member designated for error checking. This method should return a boolean value back to the driver class if any of the values "set" in the object are invalid. For invalid input, you can either terminate the program or loop to offer the user another opportunity to start again If all data are valid, build contents of a summary output statement into one output dialog. Include the following 3. o Miles driven o Days rented o Rental base charge o Rental mileage charge o Total rental charge Consider the following specifications for the program: Actual vehicle odometers measure to the 1/10 of a mile. Your program should accommodate this for both odometer inputs. Then, when calculating the files driven, always "round up" to the next highest mile for the tenths value of the difference

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

Students also viewed these Databases questions

Question

Write a letter to make request for mentorship and state why.

Answered: 1 week ago

Question

What is the nature and type of each key public?

Answered: 1 week ago