Answered step by step
Verified Expert Solution
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 or less What is
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 (including 30) More than $30 - $50 (including $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. 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 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 (including 30) More than $30 - $50 (including $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. 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
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