subject

Write a program that will ask a user for how many numbers they would like to check. Then, using a for loop, prompt the user for a number, and output if that number is even or odd. Continue doing this as many times as the user indicated. Once the loop ends, output how many even numbers were
entered and how many odd numbers were entered
Hint: For a number to be even when the number is divided by 2. there should be no remainder - so you will want to use the modulus (%) operator.
Hint: You will need two count variables to keep track of odd and even numbers.
Sample Run 1
How many numbers do you need to checks
Enter unter 20
20 is an even number.
Enter number: 3)
33 anood number
Enter ruber: 4
4 is an even number
Enter bert77
73 is an odd number
Later :
15 an even number
you entered number(s).
you entered 2 od number(s).
Sample Run 2
Hanumbers do you need to check
30 is een ruber.
Enter ute!
315 od ruber.
Enter uber 4
you entered seven number(s).
You entered 1 hue(s).
Benchmarks
1. Prompt the user to answer the question. "How many numbers do you need to check?"
2. Create and initialize two count variables one for add and one for even
3. Based on the previous input, create a for loop that will run that exact number of times.
1. Prompt the user to 'Enter number:
2. If that number is even output "Inumber is an even number:
3. Update the even count variable.
4. Orelse if the number is odd. output number is an odd number:
5. Update the odd count variable
4. Output "You entered numberleven numbers
5. Output "You entered number odd numbers)

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, deathfire5866
Determine whether the following careers would require training or college.
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, QueeeenUknown7437
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, nsjcbdhcb
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
image
Computers and Technology, 24.06.2019 02:20, isabelsmhl
Peter is thinking of a number which isless than 50. the number has 9 factors. when he adds 4 to the number, itbecomes a multiple of 5. what is thenumber he is thinking of ?
Answers: 1
You know the right answer?
Write a program that will ask a user for how many numbers they would like to check. Then, using a fo...

Questions in other subjects:

Konu
Social Studies, 02.09.2021 16:40