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]
2 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]2 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
Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alpha
kompoz [17]

A string parameter and returns new string with all the letters of the alphabet that are not in the argument string. The letters in the returned string should be in alphabetical order. The implementation should uses a histogram from the histogram function

Explanation:

The below code is written in python :

alphabet = "abcdefghijklmnopqrstuvwxyz"

test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"]

test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"]

def histogram(s):

   d = dict()

   for c in s:

       if c not in d:

           d[c] = 1

       else:

           d[c] += 1

   return d

def has_duplicates(s):

   for v in histogram(s).values():

       if v > 1:

           return True

   return False

def test_dups_loop():

   for s in test_dups:

       print(s + ':', has_duplicates(s))

def missing_letters(s):

   r = list('abcdefghijklmnopqrstuvwxyz')

   s = s.lower()

   for c in s.lower():

       if c in r:

           r.remove(c)  # the first matching instance

   return ''.join(r)

def test_miss_loop():

   for s in test_miss:

       print(s + ':', missing_letters(s))

def main():

   test_dups_loop()

   test_miss_loop()

if __name__ == '__main__':

   main()

6 0
3 years ago
Imagine that you were hired to create the label for a new brand of soup. The client wants to emphasize that the soup has homemad
lidiya [134]

Answer:

Explanation:

For tools, I would simply use Adobe Photoshop to create the label/poster for the brand of soup. In order to make the poster or representation of the soup look homemade, I would place a picture of a kid drinking the soup at a kitchen table with a picture of the mom in the background kitchen. Then I would create a light yellowish tint in the image and steam coming from the soup bowl. This would help the brand represent a form of memory to a delicious homemade meal by a parent.

4 0
2 years ago
3. Rajat wants to assign green colour to a paragraph. Write the code that will help him in completing the task
coldgirl [10]

Explanation:

use the style attribute

4 0
2 years ago
Two strategies for keeping your files in sync
zlopas [31]

Answer:

1. MS Cloud

2. G Drive

Explanation:

5 0
3 years ago
Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
natka813 [3]

Answer:

tyhgfrd

Explanation:

8 0
3 years ago
Other questions:
  • Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest
    10·1 answer
  • Which of these is a preferred method for
    14·2 answers
  • While driving you encounter an emergency vehicle stopped ahead. Discuss how the move over law applies to this situation and your
    13·1 answer
  • Alison retrieved data from a company database containing personal information on customers. When she looks at the SSN field, she
    14·1 answer
  • what is the restaurant with the black pom tree and yellow backround three letter name from hi guess the restaurant
    14·2 answers
  • 1. If an F# function has type 'a -> 'b when 'a : comparison, which of the following is not a legal type for it? Select one:
    14·1 answer
  • It is impossible to use a computer without a mouse. Is this statement true or false?
    10·1 answer
  • What is this?
    15·2 answers
  • What is the difference between MySQL and MariaDB?
    9·1 answer
  • Sistem komponen mekanikal yang terdapat pada sebuah basikal?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!