[SOLVED] COP 2800  Assignment 1

10.00 $

Categories: ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Print.zip (2.6 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

For this assignment you will write a simple Java program.  Write a class called Print.  This class has only a main method.  The main method has a single for loop with an index that increments from 0 to 19.   At each iteration of the loop, if the current value of the index is multiple of 3, the loop should print:

“How now

brown cow”  using a single print statement.

If the loop index is not divisible by 3, the loop should print:

“How now brown cow” using two print statements, one for the first two words and one for the last two words.

Your output should start out like this:

How now

brown cow

How now brown cow

How now brown cow

How now

brown cow

How now brown cow

How now brown cow

How now

brown cow

How now brown cow

How now brown cow

Examination of different methods to do printing would be helpful as well as a review of escape sequences and a review of the remainder operator should be helpful in this assignment.

If your program compiles, but you get a runtime error stating that main can’t be found, check the signature of your main method to be sure it’s correct.

 

  • Print.zip