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
Answer:
Explanation:
package sample;
import java.util.Scanner;
public class Main extends newOrder{
public static void main(String[] args) {
newOrder order = new newOrder();
order.newOrder("apple", 0.5);
order.newOrder("pear", 0.75);
order.newOrder("pineapple", 0.75);
double newTotal = order.getTotal();
order.printItems();
order.printTotal();
while (newTotal != 0) {
Scanner in = new Scanner(System.in);
System.out.println("Please enter payment type.\n" + "Cash \nDebit card \nCredit card \nCheck");
String paymentType = in.nextLine();
System.out.println("Enter the amount to pay with this type: ");
double amount = in.nextDouble();
newTotal -= amount;
System.out.println("Total after payment: " + newTotal);
}
System.out.println("Receipt Printed:");
order.printItems();
order.printSubtotal();
System.out.println("Tax: 7%");
order.printTotal();
}
}
------------------------------------------------------------------------------------------------------------
package sample;
public enum PaymentType {
CASH, DEBIT_CARD, CREDIT_CARD, CHECK
}
-----------------------------------------------------------------------------------------------------------
package sample;
import java.util.HashMap;
class newOrder {
private String name;
private double cost;
private double total;
private double subtotal;
HashMap<String, Double> itemList = new HashMap<>();
public void newOrder(String name, double cost) {
this.name = name;
this.cost = cost;
this.total += cost;
}
public void printItems() {
for (String i: itemList.keySet()) {
System.out.println( i + ": \t" + itemList.get(i));
}
}
public double getTotal() {
return (total * 1.07);
}
public void printSubtotal() {
for (double i : itemList.values()) {
subtotal += i;
}
System.out.println("Subtotal: " + subtotal);
}
public void printTotal() {
double total = subtotal * 1.07;
System.out.println("Total: " + total);
}
}
A license plate has 7 characters. Each character can be a capital letter or a digit except for 0. How many license plates are there in which no character appears more than once and the first character is a digit?
a. 9 P(35, 6)
b. 9 P(34,6)
c. 9.(35)^6
d. 9.(35)^6
Answer:
b. 9 P(34,6)
Explanation:
Since the 1st character of the number plate is the digit, therefore, there are nine possible ways to select them from digits 1 to 9.
And in the license plate there are 7 characters, the first character is counted before and the remaining 6 characters that can either be a digit or a letter has to be considered.
Now there are in total 34 symbols remaining form a total of 26 letters and 8 digits. They can be placed as 34x33x32x31x30x29 ways = P(34, 6) ways.
Therefore in total for all the characters there are 9 x P(34, 6) different ways.
Design a software system for a bookstore that keeps an inventory of two types of books: Traditional books and books on CD. Books on CD may also contain music. The bookstore purchases books from publishers and sets a price for each book. Customers can purchase books from the bookstore, using either cash or a credit. The bookstore keeps track of which books it has in its inventory, and the books purchased by each customer
a. What are the objects in your object- oriented Solution?
b. What are the interactions between objects in your solution?
c. Which objects "have" other objects?
d. Which Objects "Use" other objects?
e. Which objects are other objects?
Answer:
Explanation:
a. In this scenario, the best solution would have an Object of Traditional Books, CD, Music, Bookstore and Customer.
b. All five objects would be able to be called by the main program loop and the Customer Object would call upon and use either the Books or CD object, While the Bookstore object would call upon all of the other objects.
c. Both the Bookstore object and Customer object will "have" other objects as the Bookstore needs to hold information on every Book or CD in the Inventory. While the Customer object would call upon the Book and CD object that they are purchasing.
d. The Music Object will extend the CD object and use information on the CD object as its parent class.
e. Since the Music Object extends the CD object it is also considered a CD since it is in CD format like the Books on CD and therefore is both objects.
You can write a function to find Fibonacci numbers using recursion.
How do you find the next number?
add five to the previous number
add one to the previous number
multiply the two previous numbers
add the two previous numbers
Answer:
Add the two previous numbers
Explanation:
A recursive definition of the Fibonacci sequence would look like this, in python:
def fibonacci(n)
if n <= 1:
return n
else:
return(fibonacci(n-1) + fibonacci(n-2))
Why did Elena Gilbert Turn her humanity off when she was sired to Damon? (In The Vampire Diaries)
Answer:
Ok, so when her brother died she couldn't take it and was in denial for like the longest time. And since she was still sired to Damon bofre her humanity was off she could still listen to him.
Explanation:
What is the first step in finding a solution to a problem? Choose a solution. Think of options to solve the problem. Try the solution. Turn the problem into a question.\
Answer: Summarize the six steps of the problem solving process.
Explanation:
Answer:
turn the problem into a question
Explanation:
I got it right on a test!
A mathematical process of coding information so that only the intend user can read it
Answer:
asymmetric encryption with the intended user's public key.
Explanation:
Only that user will be able to decrypt the information.
It is for employees to make mistakes that compromise the security of an organization’s computer devices and sensitive information.
impossible
difficult
easy
Answer: Easy
Explanation: Correct on my Edg 2021.
It is simple for employees to make mistakes that jeopardize a company's computer system security and sensitive data.
What exactly is sensitive data?Sensitive information has been defined as personal data that includes facts or opinions concerning a person's race or ethnicity. political affiliations or beliefs. beliefs in religion or philosophy. Data that needs to be shielded from unwanted access in order to protect the security or privacy of a person or organization is considered sensitive information.
Pattern-based classifiers called sensitive information types (SIT) are used. To see a complete list of all SITs, see Sensitive information types entity definitions. They look for sensitive information like social security, credit card, or bank account numbers to identify sensitive things.
Therefore, It is simple for employees to make mistakes that jeopardize a company's computer system security and sensitive data.
To know more about sensitive information visit;
brainly.com/question/26191875
#SPJ3
You were just hired as an IT Specialist for Smalltown School District. Your first assignment is to review a problem area& in student records processing. It seems that the program currently used to compute student grade point averages and class rankings runs terribly slow and as a result end of year reports are habitually late. Your are asked to come up with a list of items that should be checked in order to determine if a modification to code is in order. The IT department head is asking you to do this without the opportunity to actually see the current application/programs in use. What questions would you ask about the current code? What areas of code would you look at? What would you need to know about the student data?
Answer:
Explanation:
There are various questions that you can ask in this scenario, such as
What grading policies are being implemented?
How many student grades are being calculated by the program?
What is the requirements for a student to pass?
All of these questions would allow you to get an idea of how extensive the code may be and its complexity. Once you know this you would look at the code revolving around actually looping through the data and doing the necessary calculations. You can then determine how to manipulate the code and make it much more efficient.
You would also need to know how the student data is being saved, which will help determine if it is the best data structure for saving this type of data or if it can be replaced in order to maintain the data secure while increasing the speed of the program. Mainly since this information needs to be continuously used from the data structure.
On the MarketingConsultants worksheet, in cells D10:H13, use a PMT function to calculate the end of the month payment amount. Enter one formula that can be entered in cell D10 and filled to the remaining cells. To calculate the amount for the pv argument, subtract the down payment amount from the retainer amount. The formula results should be positive.
Hiring Marketing Consultants Analysis ainted Paradise RESORT&SPA $ 125,000 5 4 Retainer Amount Term (Years) Monthly Loan Payments Down Payment $ 10,000 15,000 20,000 $25,000$30,000 2.0%, 2.5% 3.0% 3.5%. 10 12 13 15 16
Answer:
sdddddddde22
Explanation: