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

Do 1 gallon and 8 pints represents the same amount
I need the inequality answer.florence wants to buy onions and doesn't want to spend no more than $3. Can she buy 2.5 pounds ? They are 1.25 pound
I need the inequality answer.florence wants to buy onions and doesn't want to spend no more than $3. Can she buy 2.5 pounds ? They are 1.25 pound
Give this topic sentence : Swimming is really the health exercise anyone can do. What other detailed sentence you can say about the topic sentence.
Give this topic sentence : Swimming is really the health exercise anyone can do. What other detailed sentence you can say about the topic sentence.
find the volume of each sphere, both in terms of pi and to the nearest tenth. use 3.14 for pi
Anne has 24 more cards than Devi.  Anne finds that 3/5 of Devi's cards are equal to 1/2 of her cards.  How many cards does Anne have?
How many grams are in 11.9 moles of chromium?
How do I solve 2(a+2)=2?
How do you convert 2/30 into a percent ?