Answered step by step
Verified Expert Solution
Link Copied!

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

image

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

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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

In Exercises 1558, find each product. (9 - 5x) 2

Answered: 1 week ago