subject

The cash register program will have items. For each item, the name and cost are saved. For a transaction, it will accept any number of items (not known in advance) and any number of payments of different payment types (not known in advance). For each transaction, it calculates the total including a 7% sales tax and keeps prompting for a payment until the total has been paid. It also determines if any change is required. Thus, a transaction is responsible for calculating the amount of money that needs to be paid, accepting money, and generating a receipt. A receipt holds information about a transaction so that it can display how much each item cost, how the transaction was paid for, etc. (see example outputbelow).Payment type includes CASH, DEBIT_CARD, CREDIT_CARDandCHECK. Each payment consists of an amount and payment type Hints
1. All fields should be private.
2. The PaymentType class should be an enum class with values: CASH, DEBIT_CARD, CREDIT_CARD, CHECK
3. Payment type information should not print the enum directly
4. Use final to store the transaction for each receipt.
5. Output:
A. The values for subtotal, tax, total, and payment information are all aligned. You can achieve this by using the tab character '\t' in your Strings. The item lines do not need to be aligned.
B. Do not worry about only using 2 decimal places. Let Java decide how many decimal places to use.
6. Create a main class to house the main method. In the main method, create some items, a transaction, and display the receipt.
A. Example outputs
Example: Pay everything with one payment
Transaction listing the items and asking for payment:
Item 1: apple: 0.5
Item 2: pear: 0.75
Item 3: pineapple: 0.75
Total: 2.14
Please enter payment type.
1. Cash
2. Debit card
3. Credit card
4. Check
2
Enter the amount to pay with this type.
2.14
Total after payment: 0.0
Receipt printed:
apple: 0.5
pear: 0.75
pineapple: 0.75

Subtotal:
Tax:
Total:
Debit:
Change: 2.0 0.14 2.14 2.14 0.0
Example: Paying with multiple payments and payment type
Item 1: refrigerator: 800.71
Total: 856.7597000000001
Please enter payment type.
1. Cash
2. Debit card
3. Credit card
4. Check
1
Enter the amount to pay with this type.
400
Total after payment: 456.75970000000007
Please enter payment type.
1. Cash
2. Debit card
3. Credit card
4. Check
2
Enter the amount to pay with this type.
475
Total after payment: -18.240299999999934
refrigerator: 800.71
3
Subtotal: 800.71
Tax: 56.04970000000001
Total: 856.7597000000001
Cash: 400.0
Debit: 475.0
Change: 18.240299999999934
Example: Using the same payment type multiple times
Item 1: apple: 0.5
Item 2: pear: 0.75
Item 3: pineapple: 0.75
Total: 2.14
Please enter payment type.
1. Cash
2. Debit card
3. Credit card
4. Check
1
Enter the amount to pay with this type.
1.25
Total after payment: 0.8900000000000001
Please enter payment type.
1. Cash
2. Debit card
3. Credit card
4. Check
1
Enter the amount to pay with this type.
10.50
Total after payment: -9.61
apple: 0.5
pear: 0.75
pineapple: 0.75
Subtotal: 2.0
Tax : 0.14
Total: 2.14
Cash: 1.25
Cash: 110.5
Change: 9.61

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
What ordering of tcp flags makes up the three-way handshake?
Answers: 2
question
Computers and Technology, 22.06.2019 16:30
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible.restrictions: branches or loops should not be used. the code must use the internal mod and logical functions.hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible.this is matlab
Answers: 2
You know the right answer?
The cash register program will have items. For each item, the name and cost are saved. For a transac...
Questions
question
Mathematics, 21.12.2020 05:00
question
English, 21.12.2020 05:00
question
Mathematics, 21.12.2020 05:00
question
English, 21.12.2020 05:00
question
Arts, 21.12.2020 05:00
question
Mathematics, 21.12.2020 05:00
question
Mathematics, 21.12.2020 05:00
Questions on the website: 13722359