Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java//// do not copy and paste from other work because it will not match the output that I look for it. In this exercise, you

Java//// do not copy and paste from other work because it will not match the output that I look for it.

In this exercise, you will create a Java program that calculates the discount amount and final price of a video game based on the user's VIP status and the video game price. The program will use a nested if statement to determine the discount amount based on the following rules:

If the VIP status is "bronze" or "BRONZE", the discount amount is 10% if the video game price is less than $50, and 15% if the video game price is $50 or more.

If the VIP status is "silver" or "SILVER", the discount amount is 20% if the video game price is less than $25, 25% if the video game price is between $25 and $50, and 30% if the video game price is $50 or more.

If the VIP status is "gold" or "GOLD", the discount amount is 30% if the video game price is less than $10, 35% if the video game price is between $10 and $25, and 40% if the video game price is $25 or more.

The program should prompt the user for the video game price and VIP status, and then output the discount amount and final price with two decimal places.

 

Enter the video game price: 20

Enter your VIP status (bronze/silver/gold): silver

The discount amount is $4.00

The final price is $16.00

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

Question Can employees make contributions to a profit sharing plan?

Answered: 1 week ago