Question: Instruction: 1. Use Notepad to create new text file named EX05_2.java. Enter the following two lines (be sure to replace YourFullName with your full name):

Instruction: 1. Use Notepad to create new text file named EX05_2.java. Enter the following two lines (be sure to replace YourFullName with your full name): // FileName: EX05_2.java // Programmer: YourFullName 2. 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. 3. 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. 4. Make sure the output looks similar to the following. 0,0,13 0,1,11 0,2,9 0,4,5 0,5,3 1,0,8 1,1,6 1,2,4

1,3,2 1,4,0 2,0,3 2,1,1

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!