Next to the above two lines, write a Java program that declares three variables of int type, q, d, and n, to represent a set of number of coins a user must insert in order to buy a pack of cookie from the vending machine. Use three nested while loops (must be while loops) to display all possible combinations of q, d, and n, as shown below. You need to use an if statement within inner-most while loop to evaluate a Boolean condition based on the formula: 0.25q + 0.1d + 0.05n = 0.65.
I am a beginner at Java and I am really having trouble trying to write this program. If someone can help me that would be great!
Aucun commentaire:
Enregistrer un commentaire