Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

Who is David Hume and describe his utilitarian ethics?

Answered: 1 week ago