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, 23.06.2019 17:10
Ac++an of of pi. in , pi is by : pi = 4 – 4/3 + 4/5 – 4/7 + 4/9 - 4/11 + 4/13 - 4/15 + 4/17 . ., to pi (9 ). , if 5 to pi,be as : pi = 4 - 4/3 + 4/5 - 4/7 + 4/9 = 4 – 1. + 0.8 - 0. + 0. = 3.. atoofbe to pi?
Answers: 2
question
Computers and Technology, 24.06.2019 09:50
Create a string list. 2. use console.readline() to collect values of firstname, lastname, street, city, state, zip, save them to list. 3. write a simple linq statement, call method uppercasewords() to change first letter to uppercase. 4. create a foreach statment to display the information. public static string uppercasewords(string value) { char[] array = value.tochararray(); if (array.length > = 1) { if (char.islower(array[0])) { array[0] = char.toupper(array[0]); } } for (int i = 1; i < array.length; i++) { if (array[i - 1] == ' ') { if (char.islower(array[i])) { array[i] = char.toupper(array[i]); } } } return new string(array);
Answers: 3
question
Computers and Technology, 24.06.2019 20:30
How is energy expended in active transport
Answers: 1
question
Computers and Technology, 24.06.2019 21:00
Which device has the most limited computing functionality?
Answers: 1
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
Biology, 08.12.2020 04:50
question
Mathematics, 08.12.2020 04:50
question
Mathematics, 08.12.2020 04:50
question
Mathematics, 08.12.2020 04:50
Questions on the website: 13722363