Cash Register Simulation Help
Hello, I am having trouble figuring out how to simulate a cash register that accepts cash, credit cards, and checks. We did not learn about verification yet so no need for credit card verification. I do know that we need "if and else" statements but I'm not quite sure how to go about doing that. I'm thinking of having the if statement be "choice = cash" but I'm not sure where to go from there. I also need help with the methods I'll need. I need to be able to add up the total amount of the purchases, ask what the customer wants to pay with. Have one of the payments be cash then the rest on the credit card. Then give amount still owed(if applicable). Any help would be appreciated. I'm a total noob to java.
Re: Cash Register Simulation Help
It looks like you understand the problem to be solved. The next step would be to decide how to solve the problem. So now is not the time to worry about needing if else statements or "choice = cash". But while we are on the topic of "choice = cash" be sure to use == to compare instead of =, and use .equals with strings.
So without thinking about code, write down how you will be able to solve the problem.
Then go back over the solution to the problem and make sure it solves the problem without breaking any of the rules.
Once you get that done, all you have to do is translate to code. That will determine when/if you need if/else statements and if "choice == cash" or not