please answer these questions for me. thanks 394 1 Chapter 6: Repesting Instruct
ID: 3934768 • Letter: P
Question
please answer these questions for me. thanks
Explanation / Answer
Here are the solutions for you:
21.
int counter = 100;
do
{
writeLine(counter);
counter--;
}while(counter > 0);
for(int counter = 100; counter > 0; counter--)
writeLine(counter);
int counter = 100;
while(counter > 0)
{
writeLine(counter);
counter--;
}
22.
for(int i = 10; i <= 100; i += 3)
writeLine(i);
23.
writeLine("Enter the temperatures, 0 to stop: ");
total = 0.0;
count = 0;
temperature = 1;
while(temperature != 0)
{
temperature = readLine();
total += temperature;
count++;
}
average = total / count;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.