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
Kaylis [27]
3 years ago
11

Sum.Write a program that prompts the user to read two integers and displays their sum.Your program should prompt the user to rea

d the number again if the input is incorrect.
Computers and Technology
1 answer:
adelina 88 [10]3 years ago
7 0

Answer:

while True:

   number1 = input("Enter the number1: ")

   number2 = input("Enter the number2: ")

   

   if number1.isnumeric() and number2.isnumeric():

       break

 

number1 = int(number1)

number2 = int(number2)

print("The sum is: " + str(number1 + number2))

Explanation:

*The code is in Python.

Create an infinite while loop. Inside the loop, Get the number1 and number2 from the user. Check if they are both numeric values. If they are, stop the loop (Otherwise, the program keeps asking for the numbers).

When the loop is done, convert the numbers to integer numbers

Calculate and print their sum

You might be interested in
1. Es un símbolo que indica que se ha de realizar cierta operación específica entre uno o varios
irina1246 [14]

Answer:

b) Operador

Explanation:

Un operador en un lenguaje de programación es un símbolo que le dice al compilador o intérprete que realice una operación matemática, relacional o lógica específica y produzca un resultado final.

En el lenguaje de programación computacional, un operador es un símbolo o construcción que se define dentro del lenguaje de programación que indica al intérprete o compilador lo lógico, relacional, matemático, a realizar sobre un valor o entre valores.

Ejemplos de operadores son;

Operador de adición; +

Operador lógico; Y

Operador de asignación; =

Operador de comparación; >

operador typeid; typeid

6 0
3 years ago
What is the purpose of a turbine in a power plant?
anastassius [24]
C. To make the generator work

4 0
3 years ago
Which output will be displayed by the following program?
wolverine [178]

Answer:

h

Explanation:

5 0
3 years ago
Read 2 more answers
Which CSS attribute would change an element's font color to blue? font-color: blue; background: blue; color: blue; background-co
olchik [2.2K]
The Answer is color:blue for changing an element's font color to blue
8 0
3 years ago
Read 2 more answers
Design a program that asks the User to enter a series of 5 numbers. The program should store the numbers in a list then display
klasskru [66]

Answer:

The program in Python is as follows:

numbers = []

total = 0

for i in range(5):

   num = float(input(": "))

   numbers.append(num)

   total+=num

   

print("Lowest: ",min(numbers))

print("Highest: ",max(numbers))

print("Total: ",total)

print("Average: ",total/5)

Explanation:

The program uses list to answer the question

This initializes an empty list

numbers = []

This initializes total to 0

total = 0

The following loop is repeated 5 times

for i in range(5):

This gets each input

   num = float(input(": "))

This appends each input to the list

   numbers.append(num)

This adds up each input

   total+=num

   

This prints the lowest using min() function

print("Lowest: ",min(numbers))

This prints the highest using max() function

print("Highest: ",max(numbers))

This prints the total

print("Total: ",total)

This calculates and prints the average

print("Average: ",total/5)

6 0
3 years ago
Other questions:
  • What should a career plan include?
    7·1 answer
  • A computer abuse technique called a ____ involves inserting unauthorized code in a program, which, when activated, may cause a d
    11·1 answer
  • Intuitively, which of the following would happen to e⃗ net if d became very large?
    6·1 answer
  • Given an array of integers and the size of the array, write a function findDuplicate which prints the duplicate element from the
    11·1 answer
  • Which are two main areas of the properties inspector
    7·1 answer
  • create a function that has an argument is the triple jump distance. It returns the estimate of vertical jump height. The world r
    8·1 answer
  • What is the name for the size and style of text?
    8·2 answers
  • Why are Quick Parts useful in an Outlook message?
    5·1 answer
  • A tech class question any help will be greatly apprieciated
    10·1 answer
  • What is the full form of the OS?​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!