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]
2 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]2 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
The director of security at an organization has begun reviewing vulnerability scanner results and notices a wide range of vulner
gayaneshka [121]

Answer:

D. Network vulnerability database

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

In this scenario, The director of security at an organization has begun reviewing vulnerability scanner results and notices a wide range of vulnerabilities scattered across the company. Most systems appear to have OS patches applied on a consistent basis but there is a large variety of best practices that do not appear to be in place. Thus, to ensure all systems are adhering to common security standards a Network vulnerability database, which typically comprises of security-related software errors, names of software, misconfigurations, impact metrics, and security checklist references should be used.

Basically, the Network vulnerability database collects, maintain and share information about various security-related vulnerabilities on computer systems and software programs.

5 0
3 years ago
PLEASE HELP WILL MARK BRAINLIEST
Sergeeva-Olga [200]
I believe it’s boundaries
3 0
2 years ago
Read 2 more answers
1. Encrypt this binary string into cipher text: 110000. Include in your answer the formula the
puteri [66]

Answer:

Encrypt this binary string into ciphertext: 110000. Include

in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x N mod (m) = Y

-Decrypt this ciphertext into a binary string: 106

Now that you can see how public and private keys work in a real-world scenario, please explains how it works for computers and internet communications in relation to cybersecurity.

Explanation: ……………..

6 0
2 years ago
You ping a host on the internet to check for connectivity. Your ping times out, and you get no response. What is most likely the
Reptile [31]

Answer:

It could be because you where hack. Or there was something wrong with the site that stopped it from saying why it stopped.

8 0
2 years ago
In Python, the data structure that stores elements of the same data type is called an array.
Serhud [2]

Answer:

Yes

Explanation:

An array is a homogeneous data structure (elements have same data type) that stores a sequence of consecutively numbered objects--allocated in contiguous memory. Each object of the array can be accessed by using its number (i.e., index). When you declare an array, you set its size.

3 0
2 years ago
Other questions:
  • The first digital keyboard was the DX-7, introduced by the Yamaha company in 1983.
    15·1 answer
  • What does CPC stand for?
    6·2 answers
  • 50 pts DO NOT ANSWER FOR POINTS
    9·1 answer
  • Professionalism is defined as what?<br> ASAP PLEASE!
    11·1 answer
  • Enter key is also known as Return key. (True or false)
    13·2 answers
  • Need help please. this effect my technology
    15·1 answer
  • What error occurs in the following program? #include using namespace std; int main() { int number1, number2, sum; cout &lt;&lt;
    13·1 answer
  • Write a c program using loops to generate following output.
    11·1 answer
  • What is the working principle of computer?​
    10·1 answer
  • Polynomial regression A common misconception is that linear regression can only be used to fit a linear relationship. We can fit
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!