Computer Science, asked by andrewcbigham, 5 months ago

Assignment 4 evens and odds
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.
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).”
The following content is partner provided

Answers

Answered by anupamalnandan
3

Answer:

my dear friend including this much big question will not help you in brainly because no one will be reading the question even completely and you will be getting some wrong answers so it's better don't type such long questions don't feel anything bad on me

have a good day qhesd have sweet dreams and bye bye

Answered by ankitanand10
3

total = 0

i = 1

while i <=10:

total += i

i += 1

x = 0

while x < 3:

y += 1 # wrong variable updated

product = 1

count = 1

while count <= 10:

product *= count

# forgot to update count

x = 0

while x < 5:

print(x)

x += 1 # update statement is indented one level too little, so it's outside the loop body

x = 0

while x != 5:

print(x)

x += 2 # x will never equal 5, because we are counting

# numbers is a list of numbers -- we don't know what the numbers are!

total = 0

i = 0

while i < len(numbers) and total < 100:

total += numbers[i]

i +=1

for (int count = 1; count <= 8; count++)

System.out.println(count);

Similar questions