Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Encode, save, compile, execute and understand the program given below. Modify the program so that the following specifications are satisifed a.

1. Encode, save, compile, execute and understand the program given below.2. Modify the program so that the following specifications are satisifeda. Instead of “foo”, “biz” or “baz’, the factors of the number should be shown after every numberthat is not a prime number. For every prime number, the sentence “The number is prime.” isshown after the number. (Hint: The code will need to include a nested loop )b. Appropriate comments should be included in the source code.The ProblemCreate an application that displays the integers from 1 to 100 on a separate lines. After the number, print “foo” ifthe number is a multiple of 3, print “biz” if the number is a multiple of 5, and print “baz” if the number is a multipleof 7. The sample run is as follows:123 foo45 biz6 foo7 baz89 foo10 biz1112 foo1314 baz15 foo biz161718 foo1920 biz21 foo baz...The Programpublic class FooBizBaz {public static void main(String[] args) {int num;for (num=1; num<=50; num +=1){System.out.print(num + " ");if (num%3== 0)System.out.print("foo" + " ");if (num%5 == 0)System.out.print("biz"+ " ");if (num%7 == 0)System.out.print("baz"+ " ");System.out.println();}System.exit(0);} // end of main} // end of class

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question