Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I got this Java programming assignment and I am having difficulty completing this. Please see the assignment below. Thank you very much. Building on the

I got this Java programming assignment and I am having difficulty completing this. Please see the assignment below. Thank you very much. Building on the material from chapters 2 & 3 you will develop a simple cash register program. Please note that this is a simple program where we are hardcoding some of it. In future assignments, after we cover more topics, you will further develop it and make a bit more sophisticated and interactive. In addition to the regular rubrics for assignments you will be graded on the use and proper use of the following: Fields and Variables Constructors Parameters Selection statements (if-else) Methods and method calls Object creation The use of this key word Parameter use You are asked to create a CashRegister class to work with the attached CashRegisterDriverclass to produce the output shown at the bottom here after the main method in the CashRegisterDriver is called. You must use the get () methods to access any instance variables (fields) and the set () methods to change the value of any instance variable when needed. Here are some specifics to assist you: The constructor public CashRegister(int item) takes as an argument, the item number, you are planning to purchase. There are 3 items you can select from(1, 2, 3). It sets the cost of the item by calling a setCost () method according to the following price list: Item 1 costs $10.00 Item 2 costs $20.00 Item 3 costs $30.00 The computTotal() computes the total due by adding a 10% tax to the original cost. The method pay() pass on the paid amount form the main method to the object The displayTransaction computes the change and displays the transactions details.

OUTPUT =======

You have selected item number: 1

The cost of this item is: 10.0

Your total with tax is: 11.0

You have paid: 20.0

Your change is: 9.0

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions