aylapaulk3427 aylapaulk3427
  • 17-11-2017
  • Computers and Technology
contestada

Write a loop that asks the user "do you want to repeat the program or quit? (r/q)" . the loop should repeat until the user has entered an r or q (either uppercase or lowercase).

Respuesta :

meerkat18
meerkat18 meerkat18
  • 28-11-2017
Here is the loop:for (int i = 0; i < S.length(); i++) {    if (S.charAt(i) == 'R' || S.charAt(i) == 'r' || S.charAt(i) == 'Q' || S.charAt(i) == 'q') ;    System.out.println(""do you want to repeat the program or quit? (r/q)"");}
If the user enter any of the characters in the if statement the user will be asked by the question.
Answer Link

Otras preguntas

You need to implement a class that represents the state of a room or game section. The class will contain a room_id, a description, and possibly a choice1 and a
Which will diffuse the most? The particles with the A. Least potential energy. B. Most potential energy. C. Least kinetic energy. D. Most kinetic energy.
A long string with a balloon at the end was tied to the ground. After a breeze came up, the balloon was 55 feet to the right of where it was tied and 30 feet ab
Find the inverse: f(x) = 4 + 4/5 x.
help me pls with this question
What is the water source represented by the star in the image below? Tigris River Euphrates River Mediterranean Sea Red Sea
Who is your favorite character from marvel?​
4x-3=5 Please help... LIKE NOW
Identify what algorithm or concept the following code relates to. void Sort(int array[], int tempArray[], int left, int right) { int i, j, k, middle; if(right &
HELP PLS Determine which is True Select all that apply