Question: I need a pseudocode for this assignment for JAVA . Within a loop, display the menu. If the user enters an option that is not
I need a pseudocode for this assignment for JAVA
.
Within a loop, display the menu. If the user enters an option that is not 1, 2, 3, 4 or 9, display the message This option is not acceptable and loop back around to redisplay the menu. Continue in this manner until a correct option is input.
If option 1 is selected, prompt the user for the number of DVDs to buy, and once we have this number, check to see if we can afford the DVDs (based on the formula: number of DVDs to be bought * 9 <= total cash we have)
If we can, then we add the newly purchased DVDs to our current DVD count and reduce our money to whatever is left. We also output the number of DVDs we have (with the prefix text Number of DVDs:) and the cash we have (with the prefix text Cash available:) after the transaction, and re-display the main menu.
If we cannot, then we display a message saying You do not have enough money for this transaction.
If option 2 is selected, prompt the user for the number of DVDs to sell, and once we have this number, check to see if we have enough to sell
If we can, then we reduce the DVD count by the amount sold and increase the money we have (by number of DVDs sold * 10). We also output the number of DVDs we have left (with the prefix text Number of DVDs:) and the cash we have (with the prefix text Cash available:) after the transaction, and re-display the main menu.
If we cannot, then we display a message saying You do not have enough DVDs for this transaction.
If option 3 is selected, we output the number of DVDs we have left (with the prefix text Number of DVDs:) and re-display the main menu.
If option 4 is selected, we output the cash we have (with the prefix text Cash available:)and re-display the main menu.
If option 9 is selected then the Program ends.
Continue this looping until option 9 is selected.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
