Question: 1:40 a instructure-uploads.s3.amazonaws.com JAVA HA5.2: Blue, Berry, and Blueberry Write a program (Blueberry java) that uses a while loop to print the integers 1 to
1:40 a instructure-uploads.s3.amazonaws.com JAVA HA5.2: Blue, Berry, and Blueberry Write a program (Blueberry java) that uses a while loop to print the integers 1 to 100, one number on each line, and set the number's field width as 3. When a number is divisible by 3, print "Blue" on the same line, and separate them by a space. Follow the same format, when a number is divisible by 5, print "Berry" and when a number is divisible by 15, print "Blueberry". Note that a number divisible by 15 wil also be divisible by 3 and S. In this case, only "Blueberry should be printed. Amessage, "The following is from a while loop", should be printed on the first line. Three messages, one on each line, should be printed to report the total numbers of "Blue", "Bemy, and "Bluebenry respectively. Finally, in the same program, add a for loop and a do... while loop: each accomplishes the same task as the while loop. The output of your program should look exactly like the following: 5 Beczy Beery s Beery eberey 0 bersy sebry
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
