Solved CST 183 Programming Assignment 4

$30.00

Original Work ?

Download Details:

  • Name: Project4-pninsb.zip
  • Type: zip
  • Size: 483.13 KB

Category: Tags: , You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

Objective
To 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.
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:
Data
Customer classification
Days vehicle rented
Odometer mileage at start
Odometer mileage at end
Class CarRental
Methods
No-argument constructor
Parameterized constructor
set/get methods
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.
3. If all data are valid, build contents of a summary output statement into one output dialog. Include the following:
o Miles driven
o Days rented
β€’ 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.