Write a Java program that will imitate a simple cash register transaction. You should prompt the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java program that will imitate a simple cash register transaction. You should prompt the user to enter the price of the item, next calculate the GST (5%) on that price, calculate the total amount due. Next prompt the user for the amount tendered (how much money the customer has given) and calculate the change due. The format of the sales receipt is shown in the example. To complete this you will need to declare variables for price, gst, total, tendered and change. Also you will need to create three simple assignment expressions (equations) to solve for gst, total and change. Please note that all of the numbers for this program are fractional numbers so you need to use double for all your identifiers. Example Run Sales receipt Enter the price of the item: 14.0 Price 14.00 GST : 0.70 Total: 14.70 Enter the amount tendered: 15.00 Change due: 0.30 Thank you and have a nice day! Write a Java program that will imitate a simple cash register transaction. You should prompt the user to enter the price of the item, next calculate the GST (5%) on that price, calculate the total amount due. Next prompt the user for the amount tendered (how much money the customer has given) and calculate the change due. The format of the sales receipt is shown in the example. To complete this you will need to declare variables for price, gst, total, tendered and change. Also you will need to create three simple assignment expressions (equations) to solve for gst, total and change. Please note that all of the numbers for this program are fractional numbers so you need to use double for all your identifiers. Example Run Sales receipt Enter the price of the item: 14.0 Price 14.00 GST : 0.70 Total: 14.70 Enter the amount tendered: 15.00 Change due: 0.30 Thank you and have a nice day!
Expert Answer:
Answer rating: 100% (QA)
Heres a simple Java program that imitates a cash register transaction as described java import ja... View the full answer
Related Book For
Systems Analysis And Design
ISBN: 978-1119496489
7th Edition
Authors: Alan Dennis, Barbara Wixom, Roberta M. Roth
Posted Date:
Students also viewed these programming questions
-
Pollen describes American farmers today as "the most productive humans who have ever lived". Explain what he means by this. Discuss why most of these farmers can't earn enough or eat enough off their...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Jayhawks decided to acquire Tarheels corporation. Because Jayhawks is larger, after the acquisition, the combined company will use Jayhawks cost of debt and Jayhawks Debt and Equity percentages You...
-
Which of the following is most likely to be recognized as a defining characteristic of the public good? a) The good is a non-rival element. B) the good is a non-excludable item C) The good is both A...
-
The pole supports a traffic light of weight W. Using Cartesian vectors; determine the moment of the weight of the traffic light about the base of the pole at A. Given: W = 22 lb a = 12 ft θ =...
-
Solve the following log(x + 1) = 2
-
What are the ethical issues in developing a questionnaire?
-
Sams Company reported the following stockholders equity account balances on December 31, 2011. Preferred stock (12%, $100 par value, call price is $105)... $100,000 Common stock, $10 par...
-
What role do mentors play in engendering a culture of continuous learning and self-reflection among mentees, thereby instilling a growth mindset that propels individuals towards the forefront of...
-
1. The Fisher Separation Theorem states that "If capital markets are complete and perfect, production decisions are governed solely by an objective market criterion, without regard to individuals'...
-
1. Given the following arrays. int a[5]={ 3, 9, 10, 4, 6); string days[4]={"Mon", "Tue", "Wed", Thr"}; We want to call only ONE function to display each array. If the calling are Display(a, 5); and...
-
A car turns into a driveway that slopes upward at a \(9.0^{\circ}\) angle. The car is moving at \(6.5 \mathrm{~m} / \mathrm{s}\). If the driver lets the car coast, how far along the slope will the...
-
There is a photograph of a girl pushing on a large stone sphere. The sphere has a mass of \(8200 \mathrm{~kg}\) and a radius of \(90 \mathrm{~cm}\). Suppose that she pushes on the sphere tangent to...
-
It is friction that provides the force for a car to accelerate, so for high-performance cars the factor that limits acceleration isn't the engine; it's the tires. For typical rubber-on-concrete...
-
A group of students is making model cars that will be propelled by model rocket engines. These engines provide a nearly constant thrust force. The cars are light-most of the weight comes from the...
-
An airplane cruises at \(880 \mathrm{~km} / \mathrm{h}\) relative to the air. It is flying from Denver, Colorado, due west to Reno, Nevada, a distance of \(1200 \mathrm{~km}\), and will then return....
-
Assume that a closed economy is characterized by the following in the short run: C =100+3/4(Y-T) I=170-500r G =125T-100 L(r,Y)=2Y-10,000r M=10,000 P =5 a) Use the information to derive the IS and LM...
-
What are multinational corporations (MNCs) and what economic roles do they play?
-
Create a structure chart based on the data flow diagrams (DFDs) that you created for the following exercises in Chapter 5: Question D Question E Question F Question G Question H
-
Create a set of use cases for the process of buying glasses from the viewpoint of the patient, but do not bother to identify the steps within each use case. (Just complete the information at the top...
-
Explain what is meant by a functional requirement. What are the two types of functional requirements?
-
You are studying survival times for mice given a drug at one of three doses (Low, Medium, or High). You define two dummy variables: (a) With these definitions, write the expressions for the mean...
-
The data in Table 8.25 were collected in order to study factors affecting the supply and demand for commercial air travel. Data on various aspects of commercial air travel for an arbitrarily chosen...
-
It is beneficial to be able to estimate the yield of useful product of a tree based on measurements of the tree taken before it is harvested. Measurements on four such variables were taken on a...
Study smarter with the SolutionInn App