Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LEASE WRITE SOLUTION ALGORITHM. NOT JAVA CODE. WITH LOOP There are a number of validations that must occur. Think about what type of validation might

LEASE WRITE SOLUTION ALGORITHM. NOT JAVA CODE. WITH LOOP

  • There are a number of validations that must occur. Think about what type of validation might be appropriate and make sure these are all handled. Dont forget about what you learned about data validation. When invalid data is entered, the user must be provided with an error message and then re-prompted for the data.
  • Your solution will require the use of a loop structure.

Discount Insurance provides motor vehicle insurance to its customers. The company is introducing a new discount program for its customers. You have been hired by the insurance company to create a java application to calculate policy discounts for all customers.

Not all customers are eligible for a discount. Only customers who have held a policy longer than 3 years are eligible. In addition, a customer must have a driver rating of Excellent, Above Average, or Average. Customers with a rating of Below Average are not eligible for a discount.

The discount amount is calculated based on the drivers rating and percentages of current yearly premium as shown below:

Rating

Percent Discount

Excellent

15%

Above Average

10%

Average

5%

For example: A customer holding a policy for 5 years with an Excellent rating and current yearly premium of $450, will get a discount calculated as:

$450 * .15 = $67.50

Your goal is to create an application to allow a user (a company staff) to continually input customer data until the user has inputted all customers and has indicated they are finished entering customer data. One by one, the application will enable the user to input a customers name, Length of current policy in years, drivers rating and current yearly premium. Based on data provided, the application must print well-formatted detail stating whether or not the customer is eligible for a discount. For customers eligible for a discount, the application must also print the amount of the discount to be awarded to the customer. Upon completion of entering all customer data, the application will print a well formatted report that includes the total number of customers entered by the user, a count of customers that are eligible for a discount, and the average discount amount.

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_2

Step: 3

blur-text-image_3

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

Oracle Database Administration The Essential Reference

Authors: Brian Laskey, David Kreines

1st Edition

1565925165, 978-1565925168

More Books

Students also viewed these Databases questions

Question

a. Describe the encounter. What made it intercultural?

Answered: 1 week ago

Question

=+6. What does the invisible hand of the marketplace do?

Answered: 1 week ago

Question

=+ 4. Why should policymakers think about incentives?

Answered: 1 week ago