Convert each of the following for loops into an equivalent while loop. (You might need to rename some variables for the code to compile, since all four parts a-d are in the same scope.) // a.
System.out.println("a.");
int max = 5;
for (int n = 1; n <= max; n++) {
System.out.println(n);
}
System.out.println();
// b.
System.out.println("b.");
int total = 25;
for (int number = 1; number <= (total / 2); number++) {
total = total - number;
System.out.println(total + " " + number);
}
System.out.println();
// c.
System.out.println("c.");
for (int i = 1; i <= 2; i++) {
for (int j = 1; j <= 3; j++) {
for (int k = 1; k <= 4; k++) {
System.out.print("*");
}
System.out.print("!");
}
System.out.println();
}
System.out.println();
// d.
System.out.println("d.");
int number = 4;
for (int count = 1; count <= number; count++) {
System.out.println(number);
number = number / 2;
}
1 answer:
Answer:
~CaptnCoderYankee
Don't forget to award brainlyest if I got it right!
You might be interested in
Answer:
C It is believable or trust worthy
Enter tab would complete an entry. I hope that helped ya!
Explanation:
how much the project will cost
Answer:
Action Center
Explanation:
The Action Center is a feature in window 8.1 that monitors security and maintenance on your computer.It notifies you when there is an issue.Through this user can view alerts and updates about software support problem.