Question: i am stuck with this question Write an enum class called PaymentType with values CASH, DEBIT_CARD, CREDIT CARD, CHECK. More enum information can be found

i am stuck with this question Write an enum class called PaymentTypewith values CASH, DEBIT_CARD, CREDIT CARD, CHECK. More enum information can befound here: https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html Create a new class called Payment. This class shouldi am stuck with this question

Write an enum class called PaymentType with values CASH, DEBIT_CARD, CREDIT CARD, CHECK. More enum information can be found here: https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html Create a new class called Payment. This class should have two private members: PaymentType type and double amount. The class should have one constructor that accepts two parameters and sets the fields to the parameters. Write getter and setter methods for each private field. Write a method called takePayment() in the Transaction class. This method should ask the user two things: 1) what type of payment they want to use, and 2) how much they will pay with that payment type. The method should continuously ask the user these questions until they enter enough money to cover the total. You can assume that the user enters double values. The format should be like the following: Please enter payment type. 1. Cash 2. Debit card 3. Credit card 4. Check" Then your program should ask the user how much they will pay with that payment type: Enter the amount to pay with this type." Then your program should do the following: 1) Create a Payment object with the information (type and amount). 2) Add the Payment object to the Transaction's ArrayList

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!