Answer to Question #326956 in Java | JSP | JSF for isaac

Question #326956

Write a program that does the following:


1. Initialize the variables.

2. Prompt the user to enter 20 numbers.

3. For each number in the list:

a. Get the next number.

b. Output the number (echo input).

c. If the number is even: {i. Increment the even count. ii. If the number is zero, increment the zero count. }otherwise, Increment the odd count.

4. Print the results.

1. You can initialize the variables zeros, evens, and odds when you declare them.

2. Use an output statement to prompt the user to enter 20 numbers.

3. For Step 3, you can use a for loop to process and analyze the 20 numbers.

In pseudocode, this step is written as follows: for (counter = 1; counter <= 20; counter++) { a. get the number; b. output the number; c. switch (number % 2) //check the remainder { case 0: increment the even count; if (number == 0) increment the zero count; break; case 1: case -1: increment the odd count; }//end switch }//end for 4. Print the result. Output the values of the variables zeros, evens, and odds.



0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS