[Solved] COP 2800 Assignment 1

$25

File Name: COP_2800_Assignment_1.zip
File Size: 197.82 KB

SKU: [Solved] COP 2800 Assignment 1 Category: Tag:
5/5 - (1 vote)

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 cant be found, check the signature of your main method to be sure its correct.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] COP 2800 Assignment 1
$25