Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CPS 180 Homework Assignment 1: CashRegister.java Due date: Sunday, September 16th, 2018 Submission: submit CashRegister.java to Blackboard The main purpose of this assignment is to
CPS 180 Homework Assignment 1: CashRegister.java Due date: Sunday, September 16th, 2018 Submission: submit CashRegister.java to Blackboard The main purpose of this assignment is to get familiar with variable declaration, accepting user input, and formatting output. Assuming that we are trying to develop a simple cash register for a grocery store. The register will handle three items only: apple, coke, and T-shirt. The constant data it has are as following: final double APPLE-PRICE -6.99; final double cokE PRICE-1.99 final double TSHIRT PRICE-5.99; The register should ask customer for the quantity of apples, coke, and T-shirt, respectively. Once it got the input, it will calculate total price for each item and display the price detail. Notice that 6% tax should be collected for T-shirt (i.e., tshirtTotal 1.06). TSHIRT-PRICE * tshirtQuantity * Write program to simulate the following minimum interaction and output (you can add more interaction or output based on this): Enter quantity Enter quantity for coke: Enter quantity for T-shirt Unit Price Quantity Total le .99 5.99 Total you need to pay 2 12.7 32.55 Remember to declare variables to hold quantity and total price for each item. The output should be calculated based on user input. DO NOT hardcode values Hint: use printf statement to format output. Print line by line
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