What is the purchase amount?50 Sales: 50.0 Shipping: 5 tax: 3.0 Total Sales:58.0 Example output 3:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
SalesCheckoutjava Java program that calculates and displays the total cost at a sales checkout impor... View the full answer
Related Book For
An Introduction to the Mathematics of Financial Derivatives
ISBN: 978-0123846822
3rd edition
Authors: Ali Hirsa, Salih N. Neftci
Posted Date:
Students also viewed these mathematics questions
-
What is the appropriate journal entry if direct materials of $8,000 and indirect materials of $32,000 for a job are sent to the production line? a. Dr Work-in-Process Control 40,000 Cr Materials...
-
Write a program that calculates a numerical approximation to the following integral: (3.91)
-
Write a program that calculates and prints a monthly paycheck for an employee. The net pay is calculated after taking the following deductions. The user must enter Employee Name and the Gross Pay....
-
Consider the following graph. 2 7 6 C 10 10 H 11 E 12 15 14 (a). Find a minimum spanning tree of the graph using Kruskal's algorithm. List the edges in the order they are put into the tree. (b)....
-
What questions should you ask the seller, or the seller's agent, before buying a house for your personal residence?
-
Excess capacity of a firm can lead to underutilization of its assets, while a decision to decrease capacity can result in lost opportunities. Identify examples where businesses have incurred...
-
The accountant for Fast Deliveries Ltd accumulates the following data concerning a mixed cost using kilometres as the activity level. Required Compute the fixed and variable cost elements using the...
-
Atwood's Machine A 15.O-kg load of bricks hangs from one end of a rope that passes over a small, frictionless pulley. A 28.O-kg counterweight is suspended from the other end of the rope. As shown in...
-
Please discuss the role of an administrative healthcare professional and the skills and characteristics needed to perform this role successfully. Your response must be at least 10 well-written,...
-
Gulf Uniform Supply, Inc. (GUS), a merchandising business, is organized as a corporation. The business sells a complete line of uniforms for a variety of businesses and organizations, including...
-
Create a view Course_Grades showing GPA of all the students in a class with Class_Code: 11794. Include Student_Number, Student_Name, GPA. Grant read ability to Joshi for this view. Provide a select...
-
Karenjit Kaur Studio purchases a Professional Red Camera. Book value of that camera was $50,000. The purchase included a 13% tax. The supplier offered the company a 16% Discount on the base price. No...
-
1.Explain why senior management might overstate or understate business performance. 2.Identify and explain three methods financial statement fraudmay be committed. 3.Explain how fictitious revenue...
-
Imagine that you own a small clothing store specializing in men's suits with gross revenues over $1,500,000 per year. You have a staff of five people, all of whom receive an annual salary: One buyer...
-
Analyze two or three differences between design capacity and effective capacity, then predict one or two challenges that you may encounter when using each method. Provide specific examples using...
-
What is the time frame for each entry being put into the portfolio?
-
3. Show that n-2 n(logn)p converges if and only if p> 1. (You can assume that the function f(x): 1 = x(log x)P is decreasing if p > 0. Treat the p < 0 case separately if you wish.)
-
B.) What is the approximate concentration of free Zn 2+ ion at equilibrium when 1.0010 -2 mol zinc nitrate is added to 1.00 L of a solution that is 1.080 M in OH - . For [Zn(OH) 4 ] 2- , K f = 4.610...
-
Consider the equation below that gives interest rate dynamics in a setting where the time axis [0, T] is subdivided into n equal intervals, each of length : where the random error terms Wt = (Wt+ Wt)...
-
You are given the following information concerning a stock denoted by St. Current value = 102. Annual volatility = 30%. You are also given the spot rate r = 5%, which is known to be constant...
-
Consider the PDE: fx + 0.2fy = 0 with X [0, 1] and Y [0, 1]. (a) What is the unknown in this equation? (b) Explain this equation using plain English. (c) How many functions f (x, y) can you find...
-
Let \(X_{1}, X_{2}, \ldots, X_{5}\) be 5 independent random variables. Find the moment generating function \[M_{\sum X_{i}}(t)=E\left(e^{t\left(X_{1}+X_{2}+\cdots+X_{5} ight)} ight)\] of the sum when...
-
Let \(X_{1}, X_{2}\), and \(X_{3}\) be independent normal variables with \[\begin{array}{lll}E\left(X_{1} ight)=5 & \text { and } & \sigma_{1}^{2}=9 \\E\left(X_{2} ight)=-2 & \text { and } &...
-
Refer to Exercise 6.36. (a) Show that \(2 X_{1}-X_{2}-4 X_{3}-12\) has a normal distribution. (b) Find the mean and variance of the random variable in part (a). Data From Exercise 6.36 6.36 Let X1,...
Study smarter with the SolutionInn App