Computers and Technology
Computers and Technology, 21.09.2020 16:01, yessy73

For this assignment, you will first prompt the user and read in two numbers from them. You need to check and make sure that both numbers are equal to or greater than 0 (can use an if or if/else statement for this). If so, multiply the two numbers together and print the new value to the screen. If the user enters a number lower than 0, remind the user that they need to enter a number greater than or equal to 0 and exit the program.
Sample Runs
Sample Program Run (user input is underlined)
Please type in two numbers: 100 250
100 * 250 = 25000
Exiting program.
Please type in two numbers: -1 27
Please only enter numbers >= 0.
Exiting program.
(Here's an alternative way to do the same thing:)
Please type in one number: 100
Please type in a second number: 250
100 * 250 = 25000
Exiting program.
Please type in one number: -1
Please type in a second number: 27
Please only enter numbers >= 0.
Exiting program.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:10, passions3534ovf6dt
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, jayjay5246
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
image
Computers and Technology, 24.06.2019 04:30, littledudefromacross
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
Answers: 1
image
Computers and Technology, 24.06.2019 14:30, heathersloan274
Which computer network component connects two different networks together and allows them to communicate? a is a node (or a device) that connects two different networks together and allows them to communicate.
Answers: 1
Do you know the correct answer?
For this assignment, you will first prompt the user and read in two numbers from them. You need to c...

Questions in other subjects:

Konu
English, 13.09.2019 20:30