1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Archy [21]
3 years ago
10

Write a program that prints the sum of the even numbers and the products of odd numbers on the screen

Computers and Technology
1 answer:
ss7ja [257]3 years ago
4 0

Answer:

The program in Python is as follows:

n = int(input("Number of inputs: "))

total = 0; product = 1

for i in range(n):

   num = int(input(": "))

   if num%2 == 0:

       total+=num

   else:

       product*=num

print("Sum of even: ",total)

print("Product of odd: ",product)

Explanation:

This prompts the user for the number of inputs, n

n = int(input("Number of inputs: "))

This initializes sum (total) to 0 and products to 1

total = 0; product = 1

This iterates through n

for i in range(n):

This gets the inputs

   num = int(input(": "))

If input is even, calculate the sum

<em>    if num%2 == 0:</em>

<em>        total+=num</em>

If otherwise, calculate the product

<em>    else:</em>

<em>        product*=num</em>

Print the required outputs

<em>print("Sum of even: ",total)</em>

<em>print("Product of odd: ",product)</em>

<em />

You might be interested in
Please help meeee , you will get 20 points
docker41 [41]

Answer:

true

Explanation:

true trueee 3uehehehdgeyeyehhehehegegegrhrtggrevegrgrhehehru

5 0
3 years ago
Read 2 more answers
Which of the following are benefits of designing a scalable system? choose 3 options.
ollegr [7]
I asked my brother since he’s kinda of tech geek and he said

The 1st, 3rd, and 5th answers are correct

Hope this helps and I hope my brother is not wrong.
7 0
3 years ago
When would a one way flag variable be used
Tamiku [17]
A one-way flag<span> can also be </span>used<span>, for example, to watch errors occuring in input data so that the program </span>could<span> ask the inputs again. A </span>variable<span> is a temporary if its value is always needed only for a very short period.</span>
7 0
3 years ago
Which are benefits of modeling a solution? Choose all that apply. allows you to be sure the problem and solution are understood
labwork [276]

Answer:

A,B,D

A. Allows you to be sure the problem and solution are understood

B. Presents the solution in a manner that is easy to share

C. Is a starting point for all other activities

4 0
4 years ago
Read 2 more answers
In 3–5 sentences, describe the unique challenges e-mail presents for business communications.
alina1380 [7]
One of the things that are a challenge, is that you have to get the correct puntuation, correct capitilization, because it's a buisness email. You ont want to mess a buisness email up. You also have to have no repating phrases and sentences. You can't be adding random words and saying "and" all the time. 
7 0
3 years ago
Read 2 more answers
Other questions:
  • What is the process of copying items from ram to a storage device?
    8·1 answer
  • Carol typed a memo to send to everyone in her department. To create this memo, she used a _____. spreadsheet word processor fax
    10·2 answers
  • Number 20, can anyone help?
    11·1 answer
  • Who can provide you with a new password when you have forgotten your old one?
    14·2 answers
  • Which are examples of non-linear presentations? Choose all that apply.
    11·1 answer
  • The physical parts or components of a computer system is called?
    8·2 answers
  • Which country was the first in the world to launch a mass media campaign in response to population growth?
    14·1 answer
  • 7.) Title text boxes on every slide must be the same format. <br> A. True <br> B. False
    15·2 answers
  • HELP PLEASE
    7·1 answer
  • Please I need help.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!