1 answer

Java Programming Using BLUEJ Modify the Game Of War project so that the game can be...

Question:

Java Programming Using BLUEJ

Modify the Game Of War project so that the game can be played until a user specifies quitting from the keyboard.

Hint: Add a Scanner object to the Driver class to read user  input and a loop to repeat the play method.

Driver-GameOfWar Class Edit Tools Options Driver × Compile Undo Cut Copy Paste Find... Close Source Code import java.util.Scanner; t A Driver to execute Game Of War program t@John Manz * @version (a version number or a date) public class Driver t A * Main method to begin execution 치 public static void main(String[] args) Game gamenew Game () game.play()

Driver-GameOfWar Class Edit Tools Options Driver × Compile Undo Cut Copy Paste Find... Close Source Code import java.util.Scanner; t A Driver to execute Game Of War program [email protected] Manz * @version (a version number or a date) public class Driver t A * Main method to begin execution 치 public static void main(String[] args) Game gamenew Game () game.play()

Answers

import java.util.Scanner; /**  * Driver to execute Game of War program.  *  * @Jhon Manz  * @version (a version number or a date)  */ public class Driver {     /**      * Main method to begin execution      */     public static void main(String[] args)     {         /**          * Here we have delared a scanner variable sc.          */         Scanner sc = new Scanner(System.in);          char c;          /**          * Do while loop will ececute until user will press N, instead of Y.          */         do         {             Game game = new Game();             game.play();              System.out.println("Do you want to continue, If yes press Y and if you don't want to continue press N : ");              /**              * here we take an character input from the user to check whether they want to continiue or quit.              */             c = sc.next().charAt(0);         }         while(c != 'N' || c == 'Y');       } } 

Driver-GameOfWar Class Edit Tools Options Driver X Compile Undo Cut Copy PasteFind..</p><p>Close Source Code t Here we have delared a scanner variable sc Scanner sc new Scanner (System.in); char c; * Do while loop will ececute until user will press N, instead of Y do Game gamenew Game() game.play (丿, System.out.println(Do you want to continue, If yes press Y and if you dont want to continue press N: * here we take an character input from the user to check whether they want to continiue or quit 치 c- sc.next().charAt(0) while(c ! NT No changes need to be saved saved 17:38 sf ^^冊脈函[HE] ENG 04-12-2018 무

If you need more help please let us know via comments.

.

Similar Solved Questions

1 answer
For Following Multiple Choice All Correct Answers Which Applied To Each Question. 1. The hydraulic head,...
For Following Multiple Choice All Correct Answers Which Applied To Each Question. 1. The hydraulic head, h, is equal to the sum of the: pressure, elevation, and velocity heads. fluid pressure and the elevation head. pressure head and elevation head. hydraulic conductivity and intrinsic permeability...
1 answer
1. (6 pts) Provide the correct IUPAC name for the following compounds. um 2. (10 pts)...
1. (6 pts) Provide the correct IUPAC name for the following compounds. um 2. (10 pts) Provide the products for the following reactions. KSCN un kesto DMSO NaSH THE KN DMF NaOH THE DMSO 3. (4 pts) Provide the common name for the following compounds. V...
1 answer
1. In your role as a manager what steps can you take both before and during...
1. In your role as a manager what steps can you take both before and during the adjourning stage to ensure team members remain motivated and loyal to the company? ... 2 marks 2. "Groupthink" can provide the illusion of agreement and accountability to a workplace team. Can "groupthink"...
1 answer
The centre of mass (G) of an empty pickup truck is "a" mm behind the front wheels as shown in figure 3. The wheelbase of the truck is 2800 mm. The weight of the truck Ws 30 kN (a) Determine t...
The centre of mass (G) of an empty pickup truck is "a" mm behind the front wheels as shown in figure 3. The wheelbase of the truck is 2800 mm. The weight of the truck Ws 30 kN (a) Determine the reaction forces that the ground imposes on the wheels at A and B (i.e. Ay and (10 marks) (b) Deter...
1 answer
A person 1.6 m tall stands 6.4 m from a reflecting globe in a garden. (a)...
A person 1.6 m tall stands 6.4 m from a reflecting globe in a garden. (a) If the diameter of the globe is 33 cm, where is the image of the person, relative to the surface of the globe? (Enter a negative value if the image forms behind the globe.) (b) How large is the person's image?...
1 answer
Could anyone help me check this? I thought this answer is wrong The 2014-15 Brisbane City...
Could anyone help me check this? I thought this answer is wrong The 2014-15 Brisbane City Council budget included 179 million dollars for public parks. If only 42 percent of Brisbane's 2.1 mllion residents value and use public parks, how much do these residents need to individually value ...
1 answer
Each row of the table below describes an aqueous solution at 25 °C. The second column...
Each row of the table below describes an aqueous solution at 25 °C. The second column of the table shows the initial components of the solution. • Use the checkboxes in the third column to explain the type of the initial solution. The fourth column describes a change in the solution. •...
1 answer
How do you find the corresponding rectangular coordinates for the point # (-1, (-3pi)/4 )#?
How do you find the corresponding rectangular coordinates for the point # (-1, (-3pi)/4 )#?...
1 answer
LIPID AND MEMBRANE QUESTIONS 1. If an unsaturated fatty acid has 18 carbons, a double bond...
LIPID AND MEMBRANE QUESTIONS 1. If an unsaturated fatty acid has 18 carbons, a double bond at position would be in notation - 2. The functional groups which hold fatty acid molecules and glycerol molecules together in triacylglecerol molecules are called: 3. If a triacylglycerol is heated in aqueous...
1 answer
Find the mass of 30 mol of sulfuric acid, H2SO4
Find the mass of 30 mol of sulfuric acid, H2SO4...
1 answer
♡ Search this course Faded 0 x cell potentials given below. Standard Reduction Potentials (Volts) at...
♡ Search this course Faded 0 x cell potentials given below. Standard Reduction Potentials (Volts) at 25 °C 12() + 2 6 2 I'(aq) 0.535 02(g) + 4 Hz0+ (aq) + 4 € -6 H,00 1.229 2 H2O(l) + 2 € H2(g) + 2 OH"(aq) -0.828 Sc3(aq) + 3 e Sc(s) -2.080 Half-reaction at anode: Half-rea...
1 answer
2. (8 points) Determine whether the polynomial has any roots with positive real parts. 14+423 +51+61...
2. (8 points) Determine whether the polynomial has any roots with positive real parts. 14+423 +51+61 +2....
1 answer
Two objects attract each other with a gravitational force of magnitude 1.01 x 10-8 N when...
Two objects attract each other with a gravitational force of magnitude 1.01 x 10-8 N when separated by 20.2 cm. If the total mass of the two objects is 5.11 kg, what is the mass of each? heavier mass lighter mass kg kg Need Help?Watch It...
1 answer
Find the characteristic equation of A, the eigenvalues of A, and a basis for the eigenspace...
Find the characteristic equation of A, the eigenvalues of A, and a basis for the eigenspace corresponding to each eigenvalue. -5 14 A= 011 003 (a) the characteristic equation of A (b) the eigenvalues of A (Enter your answers from smallest to largest.) (14, 12, 23) = (c) a basis for the eigenspace co...