Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the purchase amount?50 Sales: 50.0 Shipping: 5 tax: 3.0 Total Sales:58.0 Example output 3: Re-prompt for numbers more than 100 or 0

What is the purchase amount?50Sales:50.0 Shipping:5 tax:3.0Total Sales:58.0Example output 3: Re-prompt for numbers more thPart 2 - Program LogicWrite a program that calculates the total cost of an item at a sales checkout.The Total cost is its p  

What is the purchase amount?50 Sales: 50.0 Shipping: 5 tax: 3.0 Total Sales:58.0 Example output 3: Re-prompt for numbers more than 100 or 0 or less What is the purchase amount? Sales too small. Please Try again What is the purchase amount?101 Sales too large. Please Try again What is the purchase amount?25 Sales:25.0 Shipping: 1.25 tax: 1.5 Total sales: 27.75 Example output 4: All output is rounded What is the purchase amount?99.11111 Sales:99.11 Shipping: 7.5 tax: 5.95 Total Sales:112.56 Part 2 - Program Logic Write a program that calculates the total cost of an item at a sales checkout. The Total cost is its purchase price + shipping cost + sales tax Your program should: a. Prompt the user for an item's purchase price. b. Calculate the Sales Tax. It is always 6% of the purchase price (so a sale of $10 has sales tax of 60 cents). c. Calculate the shipping cost based on the following table: Purchase Price Shipping Cost More than 0 - $25 (including 25) $1.25 More than $25.00 - $30.00 $2.25 $5 50) More than $50 $7.50 d. Output the original purchase price, the total shipping costs and tax in one line and the total sales amount on the next. (See example output below.) e. Round all output to the nearest penny. (including 30) More than $30-$50 (including Part 3 - Filter the user input. If the user enters a value more than 100 let them know the sales is too large and then re-prompt Sorry that sales number is too large. Please try again. If the user enters a value of 0 or less and then print out the following and re-prompt Sorry that sales number is too small. Please try again. Example output 1:100 dollars has 7.50 shipping What is the purchase amount? 100 Sales: 100.0 Shipping:7.5 tax: 6.0 Total Sales: 113.5

Step by Step Solution

3.53 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

SalesCheckoutjava Java program that calculates and displays the total cost at a sales checkout impor... 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

An Introduction to the Mathematics of Financial Derivatives

Authors: Ali Hirsa, Salih N. Neftci

3rd edition

012384682X, 978-0123846822

More Books

Students also viewed these Mathematics questions

Question

Was the experimental treatment described in sufficient detail?

Answered: 1 week ago

Question

mple 10. Determine d dx S 0 t dt.

Answered: 1 week ago