subject

Assignment 4: Evens and Odds (FIX PLEASE) 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 check? 5
Enter number: 20
20 is an even number.
Enter number: 33
33 is an odd number.
Enter number: 4
4 is an even number.
Enter number: 77
77 is an odd number.
Enter number: 8
8 is an even number.
You entered 3 even number(s).
You entered 2 odd number(s).
Sample Run 2
How many numbers do you need to check? 3
Enter number: 10
10 is an even number.
Enter number: 3
3 is an odd number.
Enter number: 400
You entered 2 even number(s).
You entered 1 odd number(s).

Benchmarks
Prompt the user to answer the question, “How many numbers do you need to check? “
Create and initialize two count variables - one for odd and one for even.
Based on the previous input, create a for loop that will run that exact number of times.
Prompt the user to “Enter number: “
If that number is even, output “[number] is an even number.”
Update the even count variable.
Or else if the number is odd, output “[number] is an odd number.”
Update the odd count variable.
Output “You entered [number] even number(s).”
Output “You entered [number] odd number(s).”


Assignment 4: Evens and Odds (FIX PLEASE)

Write a program that will ask a user for how many numbe

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Wich technology can a website use to allow you to listen to a concert live over the internet?
Answers: 3
question
Computers and Technology, 23.06.2019 04:00
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
question
Computers and Technology, 23.06.2019 11:00
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
question
Computers and Technology, 24.06.2019 02:40
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
You know the right answer?
Assignment 4: Evens and Odds (FIX PLEASE) Write a program that will ask a user for how many numbers...
Questions
question
Mathematics, 24.08.2019 09:20
question
Mathematics, 24.08.2019 09:20
question
Social Studies, 24.08.2019 09:20
Questions on the website: 13722361