Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use ONLY topics covered in Modules 1 - 3 to solve question. Submit source code (.java) and a sample run that MATCHES the sample
Use ONLY topics covered in Modules 1 - 3 to solve question. Submit source code (.java) and a sample run that MATCHES the sample runs provided. "U Rock", a precious metals dealer sells 1 oz. silver bars. Price is depend on whether you want pickup or deliver as well as the number of bar purchased. Depending on the quantity of silver bars you want to purchase the company offers the following daily rates. If you user wants delivery of the bars the price is $10 for less than 20 bars and $20 for 20+ bars. There is a $10 admin fee for all purchases. Quantity 1 2-10 11+ Price per bar $25 $23.50 per bar $23 per bar Write a program that prompts the user to enter the quantity of silver bars the user wants to buy and whether they want free pickup or delivery for the bars. The program should calculate the cost, GST, and total cost and print in format displayed in the sample runs below. Use finals for the constants. Submit source code (.java) and sample runs THAT MATCH the sample runs provided below. Use 5% for the GST rate. GST = Cost * GST Rate / 100 Assume that the user always enters valid inputs. Use printf for rounding only. (User input is shown in bold underline). Sample Run #1 Enter the % of bars to purchase: 1 Do you want to pickup (0) or delivery (1): 0 1 Silver Bars (loz) Cost GST Total 35.00 1.75 $36.75 Sample Run #2 Enter the #23 of bars to purchase: 2 Do you want to pickup (0) or delivery (1): 1 2 Silver Bars (loz) Cost GST 67.00 3.35 $70.35 Total Sample Run #3 Enter the #2 of bars to purchase: 20 Do you want to pickup (0) or delivery (1): 1 20 Silver Bars (loz) Cost GST Total 490.00 24.50 $514.50
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started