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 driver’s 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 customer’s name, Length of current policy in years, driver’s 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. Other Requirements: You may not ask the user how many customers they will enter Your solution must not use arrays. Remember to think about what constitutes valid input. Your solution must address this. Your solution may not use any functions or language constructs not covered during this semester’s IT 106 without prior authorization from your instructor, even if you know other functions or language constructs. We want everyone to be on the same "playing field", regardless of previous programming exposure, and get practice with algorithmic design to solve problems (the intent of the course). Using something existing not discussed in class does not give you as much practice as solving the problem yourself. Doing this may lead to a substantial grade penalty, a grade of zero, or an Honor Code inquiry. When in doubt, ask! Hints: 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. Don’t 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. Remember to parse String data using constructs like Integer.parseInt() and Double.parseDouble() where necessary. Additionally, when using these constructs, don’t forget to include try/catch for good validation. Your solution will require use of a loop structure.     Programming Assignment 1: Solution Design Create a defining diagram that shows the input, processing, and output Create a solution algorithm using pseudocode Show testing using the desk checking table method, to include test data, expected results, and a desk checking table. Make sure your desk checking considers multiple cases including both valid and invalid test data to prove your algorithm will work in all cases

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter5: The Repetition Structure
Section: Chapter Questions
Problem 14E
icon
Related questions
Question

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 driver’s 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 customer’s name, Length of current policy in years, driver’s 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.

Other Requirements:

  • You may not ask the user how many customers they will enter
  • Your solution must not use arrays.
  • Remember to think about what constitutes valid input. Your solution must address this.
  • Your solution may not use any functions or language constructs not covered during this semester’s IT 106 without prior authorization from your instructor, even if you know other functions or language constructs. We want everyone to be on the same "playing field", regardless of previous programming exposure, and get practice with algorithmic design to solve problems (the intent of the course). Using something existing not discussed in class does not give you as much practice as solving the problem yourself. Doing this may lead to a substantial grade penalty, a grade of zero, or an Honor Code inquiry. When in doubt, ask!

Hints:

  • 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. Don’t 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.
  • Remember to parse String data using constructs like Integer.parseInt() and Double.parseDouble() where necessary. Additionally, when using these constructs, don’t forget to include try/catch for good validation.
  • Your solution will require use of a loop structure.

 

 

Programming Assignment 1: Solution Design

  • Create a defining diagram that shows the input, processing, and output
  • Create a solution algorithm using pseudocode
  • Show testing using the desk checking table method, to include test data, expected results, and a desk checking table. Make sure your desk checking considers multiple cases including both valid and invalid test data to prove your algorithm will work in all cases
Expert Solution
Step 1

Actually,  given information regarding:

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 driver’s rating and percentages of current yearly premium as shown below:

Rating

Percent Discount

Excellent

15%

Above Average

10%

Average

5%

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT