Need Programming for Java Add an import statement to use the Scanner class. Decl
ID: 3550902 • Letter: N
Question
Need Programming for Java
Add an import statement to use the Scanner class.
Declare a constant representing a sales tax rate of 7.25%.
Declare three double variables named price, salesTax and total.
Declare a Scanner object named keyScan for keyboard input.
Display a banner message, or greeting, of the following: Welcome to the CSCI 210 Pricing System
Skip a line and display a prompt of the following: Enter the item's price:
Get the user's input using the Scanner method nextDouble( ) and assign the value to the variable named price.
Skip a line and display the item's price with two decimal places and full editing with a floating dollar sign and commas between the thousands places if necessary.
Calculate the sales tax using the constant you created for tax rate and the price and assign it to the variable named salesTax.
On the line immediately following the item's price, and with the decimal points lined up in the same column, one over the other, display the sales tax with two decimal places and full editing with a floating dollar sign and commas between the thousands places if necessary.
On the line immediately following the sales tax, display 13 hyphens.
Calculate the total of the sale and assign it to the variable named total.
On the line immediately following the line with 13 hyphens, display the total with the decimal point lined up under the previous two dollar amounts and with two decimal places and full editing with a floating dollar sign and commas between the thousands places if necessary..
After everything, skip a line and display "Thank you for using the Pricing System!"
Sample output with the user entering 1004.58 when prompted:
Welcome to the CSCI 210 Pricing System
Please enter the item's price: 1004.58
Price: $1,004.58
Sales Tax: $72.83
-------------
Total: $1,077.41
Thank you for using the Pricing System!
Use the edit pattern of "$#,###,##0.99" in your program.
Document your program correctly and adequately.
Explanation / Answer
Deadline for this ?
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.