Assignment 4: Evens and Odds
Instructions

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).

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
1. Create and initialize two count variables - one for odd and one for even.
2. Prompt the user to answer the question, “How many numbers do you need to check?"
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 “[number] is an even number.”
3.Update the even count variable.
4.Or else if the number is odd, output “[number] is an odd number.”
5.Update the odd count variable.
4.Output “You entered [number] even number(s).”
5.Output “You entered [number] odd number(s)."

Answers

Answer 1
Wow that is really long

Related Questions

Frankie is in charge of writing a script for a television show, along with six other writers. The script must be finished by the end of the week. Frankie’s co-workers all bring slightly different strengths to the table, but all are at least competent. Frankie wants to write the best possible script in the generous amount of time he has to work with. In this example, which style of leadership would be most effective for Frankie’s goals?
a.
Authoritarian
b.
Coaching
c.
Democratic
d.
Delegative

Answers

The best type of leadership for Frankie would be C, Democratic.

The style of leadership would be most effective for Frankie’s goals is Democratic. Thus, option C is correct.

What is Democratic leadership style?

This is known to be a form of government where the the people rule through their elected representative. Note that The style of leadership would be most effective for Frankie’s goals is Democratic as it is where one can listen to what the people has to say.

A good leader must be willing to adopt the style which suits the situation they are in. When dealing with inexperienced employees, an authoritarian style might be the best.

A scripting language or script language is a programming language for a runtime system that automates the execution of tasks that would otherwise be performed individually by a human operator.

Therefore, The style of leadership would be most effective for Frankie’s goals is Democratic. Thus, option C is correct.

Learn more about Democratic from

brainly.com/question/3710021

#SPJ5

A program uses 4 bits to store numbers. When it adds 10 and 7, the result is 1. Which of the following best explains why?
1) the program is reporting the number of bits required to compute the sum
2) an overflow error led the program to reset to O at the number 16
3) 1" is an error code that indicates a rounding error
4) 4 bits is not enough to represent the number 10, so the computer reported only the tens value

Answers

Answer:

2

Explanation:

overflow

A data type overflow issue typically occurs when the data type used to store the data was unable to accommodate the data. In addition, some data types are limited in the size of the numbers they can hold. If a data type is a single byte and the amount of data to be saved is larger than 256, an overflow error will be generated. Thus, option B is correct.

What an overflow error led the program to reset?

Using exception handling, these mistakes can be addressed. We will examine this exception handling in the section that follows.

We observed the Overflow error in the aforementioned programs, which happens when the current value exceeds the limit value. Furthermore, we must raise the overflow Error exception in order to manage this.

Therefore, When software encounters an overflow error, it means that it tried to write data outside the memory's capacity. Every program has memory set aside for a stack.

Learn more about overflow error here:

https://brainly.com/question/27493058

#SPJ2

An audio recording has five minutes of silence at the beginning. Which audio-editing technique will delete this unwanted silence?

topping and tailing

normalizing

equalizing

dithering

Answers

Answer:

topping and tailing

Explanation:

What is output? Select all that apply. c = 0 while (c < 5): c = c + 1 print(c) 6 5 2 4 3 0 1

Answers

Answer:

2 4 3 0 1

Explanation:

A. Fill in the blanks:
1.
is an effective way to display data in pictorial form.
2. Data series are the bars or slices that show the
3. Barchart displays data in the form of long
rods.
4.
is the vertical axis that is used to plot the values.
5.
is a key that is used to identify the colours, patterns, or symbol assigned to a data series.

Answers

Answer:

1. Charts.

2. Data series.

3. Rectangular.

4. Y-axis.

5. Legend.

Explanation:

1. Charts: is an effective way to display data in pictorial form. It includes the use of pie charts, bar charts, venn diagram, etc.

2. Data series: are the bars or slices that show the data values. It comprises of related data sets.

3. Barchart displays data in the form of long rectangular rods. Generally, bar charts are used for the comparison of informations obtained from a data collection by representing each value (information) with rectangular bars respectively. A bar chart has a x-axis and a y-axis used to represent the various categories of data collected.

4. Y-axis: is the vertical axis that is used to plot the values. The other axis for plotting values is known as X-axis.

5. Legend: is a key that is used to identify the colours, patterns, or symbol assigned to a data series.

a pair of shoes is on sale for 15% off with this discount customers will pay $9 if they buy the shoes ​

Answers

Answer:

do 15% on a calculator then divide by 9

Explanation:

To add your own unique ideas to completed 3D models, you do not need to understand the design process of the 3D model's creator.

Answers

Answer:

It depends

Explanation:

If the model is a spliced model, and has many different rigged parts (maybe like a movable T-rex or something), then you need to understand how it all works, and how it was made, but if its a solid object (lets say a rubber duck model) that you want to add stuff to, or change the color of, then you don't really need background info.

sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses i am a failure sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses sunglasses

Answers

Answer:

SUNGLASSES!!!!! Also, side note, you're not a failure!

EISDHUOSHSD ITS WORLD WIDE HANDSOME

The unique identifier for each record in a database table is called the

A. Record Id
B. Id number
C. Primary key
D. Row number

Answers

The answer is C. Primary Key. I hope this helps

Answer:

C

Explanation:

Thank the other person

please can somebody help me! i’m really stuck on this question

Answers

Answer:

import turtle

t = turtle.Turtle()

t.speed(0)

for x in range(1,10):

 for i in range(4):

   t.forward(20*x)

   t.right(90)

The ___ function can be entered by clicking the cell where you want to add the funtion such as cell J6. Then click the arrow next to the autosum button and choose averange

Answers

Answer:

The name of the function that can be added to a cell below a column of numbers or to the right of a row of numbers to find the average by clicking on the AutoSum button on the HOME tab is;

Average

Explanation:

The average function is the function used to quickly find the arithmetic mean, 'μ', or average of a number group, x₁, x₂, x₃, ...xₙ, which is given by dividing the sum of the numbers by the count, 'n', of the numbers, as follows;

μ = ∑x/n

The AutoSum can be used to find the average in Microsoft Excel by clicking on the next cell to row of cells to the right or immediately below the column of cells, then clicking on the down arrow on the right of the AutoSum button on the HOME tab and selecting Average from among the options, the average of the numbers in the column or row of cells will be displayed in the selected cell.

Therefore, we have;

The Average function can be entered by clicking the cell where you want to add the function such as cell J6. Then click the arrow next to the AutoSum button and choose average

When is it appropriate to delete an entire row or column as opposed to deleting the data in the row or column

Answers

Answer:

huh wdym

Explanation:

What stops the current loop and resumes execution at the next statement?
the break statement

the final statement

the pass statement

the infinite-loop statement

Answers

Answer:

break statement:))

Explanation:

The statement that stops the current loop and resumes execution at the next statement is known as the break statement. Thus, the correct option for this question is A.

What is the break statement?

The break statement may be defined as a type statement that effectively terminates the execution of the nearest enclosing do, for, switch, or while statement in which it considerably appears.

While performing the break statement control passes to this statement and follows the termination of the break statement very efficiently. The purpose of the break statement is to break or terminate a loop function as early as possible.  

Therefore, the break statement is the statement that stops the current loop and resumes execution at the next statement. Thus, the correct option for this question is A.

To learn more about Break statements, refer to the link:

https://brainly.com/question/14548592

#SPJ2


dash+dash=100
Both dash and dashare prime numbers.
How many different solutions can you find​

Answers

Answer:

6

Explanation:

97+3 = 100

89+11 = 100

83+17 = 100

71+29 = 100

59+41 = 100

53+47 = 100

I counted them using excel, see pic.

Answer:

?

Explanation:

?

Give me 4 examples of things to consider as a sound designer?
HURYYYYY IM TIMED

Answers

Answer:

Sound design components include sound effects or SFX sound design, mixing, Foley sound design, dialogue, and music.

Explanation:

Evaluate if the following function is a good candidate to be placed in a library. Why or why not?

Answers

Answer:

It cannot be a good candidate because the creator of the library is attempting to update the global variables player1Points and player2Points. The updated scores for each player won't be retained unless someone creates the global variables player1Points and player2Points in their program.

The updateScore function is meant to update the point of player1 and player2 ; since the variables player1 and player2 are only defined in the function, then they do not have a global scope. Hence, the function isn't right to be placed in a library.

Variables defined outside a function are called global variables ; hence, they can be referenced anywhere within the program.

Since the function references a global variable, then any program which intends to use the function must have the variables player1 and player2 must be defined globally in the program.

Hence, it is not a good candidate to be placed in a library.

Learn more:https://brainly.com/question/20720413

Recognizing the trade-off between interesting design features and cost is part of which stage of the product development life cycle?

Answers

Answer: detailed product design

Explanation:

Which of the following is the main cause of network failure?

A. cables that break
B. peripherals that get in the way
C. storms
D. human error

Answers

Answer:

Possibly A or C

Explanation:

Answer: human error is the right answer!!!!!

Explanation:

I took the quiz

Type the correct answer in the box. Spell all words correctly. Complete the sentence based on what you know about target audiences. Two people belonging to the same may like different types of films.​

Answers

Answer: Demographic

Explanation: For example, a 70-year-old retired war veteran may enjoy a war movie, but a retired banker of the same age may not. I got this correct on the test

Which are malicious codes?
Select all that apply.
Spyware
Serum
Key loggers
Worms
JavaScript​

Answers

Answer:

Spyware

Key Loggers

Worms

Issue: I don't know what Serum is.

PowerPoint SAM Capstone Project 1 can PLEASE someone do it for me I have some directions like steps and you just have to do it in a powerpoint slide please I would really appreciate it

Answers

Answer:

Sooo what's the question??

Explanation:

Answer:

kk

Explanation:

What is 36 Denary in Binary?? PLEASE ANSWER I WILL GIVE U BRAINLY!!

Answers

Answer:

100100

Explanation:

Heres my answer i hope it helps

Answer:

100100

If you want to know the binary representation of any decimal number up to 7 digits, check out the Decimal to binary converter.

Explanation:

The binary number represented by the voltage graph below is

Answers

Answer:

The binary number represented by the voltage graph is bits

Explanation:

Answer:

Heres both answers and how to read them

Explanation:

100% on the quiz

Other Questions
Only the smartest person in science can help me right now...1. Use the given soil triangle. What percentage of sand does loam have?2. Use the given soil triangle. What percentage of silt does loam have?3. Use the given soil triangle. Look for the letter B in Sandy Clay Loam. What percentage of clay does "B" have?4. Use the given soil triangle. Look for the letter B in Sandy Clay Loam. What percentage of silt does "B" have? An audio recording has five minutes of silence at the beginning. Which audio-editing technique will delete this unwanted silence?topping and tailingnormalizingequalizingdithering Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is:As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x // 2Note: The above algorithm outputs the 0's and 1's in reverse order. You will need to write a second function to reverse the string.Ex: If the input is:6the output is:110Your program must define and call the following two functions. The function integer_to_reverse_binary() should return a string of 1's and 0's representing the integer in binary (in reverse). The function reverse_string() should return a string representing the input string in reverse.def integer_to_reverse_binary(integer_value)def reverse_string(input_string)Note: This is a lab from a previous chapter that now requires the use of a function. What infection type can send information on how you use your computer to a third party without you realizing it How could this document help you argue for abolishing the Electoral College? Saudi Arabia has traditionally been an oil-based economy with strong government controls over major economic activities. To diversify the economy, the Saudi government is working to increase the private sector. These efforts focus on telecommunications, power generation, and chemicals. Which economic system is described in this statement? a. Traditional b. Primitive c. Market d. Mixed shen buys candy that costs $4 per pound he will spend at least $20 on candy what are the possible numbers of pounds he will buy HELP ASAP WHICH OF TJE FOLLOWING IS THE SOLUTION OF THE EQUATION??( I picked a random answer) Solve the inequality 13 > 3x + 1 How many states are in the south? What is the most important mountain animal for the people of Nepal? Divide. -24 divided by 7 Enter your question as a mixed number, in simplified form, in the box. Please hurry! Thank you :D ela denotation. pls help out :) if the forces on an object are balanced the resultant force is equal to zero true false For this assignment, you should mathematically solve and record a video testing your solution for the following prompt: Two rolls of toilet paper, of equal mass and radius, are dropped from different heights so that they hit the ground at the same time. One roll of toilet paper is dropped normally while the other is dropped while a person holds onto a sheet of toilet paper such that the roll unravels as it descends. Determine the ratio of heights h1/h2, where h1 represents the height of the toilet paper dropped normally and h2 represents the height of the toilet paper that unravels, so that both rolls hit the ground at the same time. Please answer please Ill give you brainless. Its important. Please According to the article, black students at Warren County High School were not included by their white classmates. Which paragraph from the article BEST supports the idea outlined above? * Please help i need to help A. Fill in the blanks:1.is an effective way to display data in pictorial form.2. Data series are the bars or slices that show the3. Barchart displays data in the form of longrods.4.is the vertical axis that is used to plot the values.5.is a key that is used to identify the colours, patterns, or symbol assigned to a data series. Describe a time when you had to stand up for what was right.