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
posledela
3 years ago
13

For this portion of the lab you will design the solution so that you perform some conditional tests. For this lab: 1. You will v

alidate input to ensure that the user enters inputs within a certain range or larger than a certain minimum value. You will validate the inputs as follows: (LO 1, 2, 3) a. The user cannot enter a negative number for: i. Miles to kilometers ii. Gallons to liters iii. Pounds to kilograms iv. Inches to centimeters b. The user cannot enter a value above 1000 degrees for Fahrenheit to Celsius (LO1)c. You MUST design a logical program exit. You may NOT use exit, break, quit, or system exit, or ANY OTHER forced exit. Do not use a menu. Use LOGIC to exit the program. 2. If the user enters an invalid value, then the program will issue an error message and terminate immediately. (Do NOT accept further data).3. Save the program as firstname_lastname_Lab3a.py where you will replace firstname and lastname with your actual first and last name.4. Test all conditions prior to submitting.
Computers and Technology
1 answer:
PIT_PIT [208]3 years ago
4 0

Answer:

#Prompt the user to enter the miles.

Miles = float(input('Enter the miles to convert into kilometer: '))

#Check the miles.

if Miles >= 0 :

   #Convert the miles to kilometers.

   Miles_To_km = Miles*1.6

   #Display the result.

   print (Miles, "miles equivalent to", Miles_To_km, "kilometer.")

   #Prompt the user to enter the gallons.

   Gallon = float(input('Enter the gallons to convert into liter: '))

   #Check the validity of the Gallons entered.

   if Gallon >= 0:

       #Convert gallons into liters.

       Gal_To_Lit = Gallon*3.9

       #Display the result.

       print (Gallon, "gallons equivalent to", Gal_To_Lit, "liters.")

       #Prompt the user to enter the pounds.

       Pound = float(input('Enter the pounds to convert into kilograms: '))

       #Check the validity of the Pounds entered.

       if Pound >= 0:

           #Convert pounds into kilograms.

           Pounds_To_Kg = Pound*0.45

           #Display the result.

           print (Pound, "pounds equivalent to", Pounds_To_Kg, "kilograms.")

           #Prompt the user to enter the temperature in Fahrenheit.

           f = float(input('Enter the temperature in Fahrenheit: '))

           #Check the value to be not greater than 1000.

           if f < 1000:

               #Convert Fahrenheit into celsius.

               F_To_C = (f -32)*5/9

               #Display the result.

               print (f, "Fahrenheit equivalent to", F_To_C, "celsius.")

           #Otherwise.

           else:

               

               #Display the error message.

               print ("Invalid temperature (greater than 1000) !!!")

       else:

           #Display the error message.

           print ("Pounds cannot be negative !!!")

   else:

           #Display the error message.

           print ("Gallons cannot be negative !!!")

else:

   #Display the error message.

   print ("Miles cannot be negative !!!")

Explanation:

You might be interested in
_____ emphasizes identifying and monitoring the sources of new technologies for an industry. Licensing Differentiation Environme
nalin [4]
Mass is the answer if u need me ask me ok

8 0
3 years ago
Why would a virtual machine be useful in a school? It provides a completely secure connection to the internet. Students can coll
Stels [109]
They can learn more and also it’s faster
5 0
3 years ago
Write a java program.
Sliva [168]

Answer:

The source code has been attached to this response. It contains comments explaining each line of the code. Kindly go through the comments.

To run this program, ensure that the file is saved as ArithmeticProcessor.java

Keep editing line 7 of the code to test for other inputs and arithmetic operation.

A sample output has also been attached to this response.

6 0
3 years ago
Question 4 True or false: The same plaintext encrypted using the same algorithm and same encryption key would result in differen
Cloud [144]

Answer:

False

Explanation:

7 0
2 years ago
You are the network administrator for Corpnet.com. You install the Windows Server Backup Feature on a Windows Server 2012 R2 fil
Vsevolod [243]

To ensure that multiple backups of the server are available for restores you should Modify the frequency of the scheduled backup.

a. Modify the frequency of the scheduled backup.

<u>Explanation:</u>

To backup system normal and good practices schedule every day either different folder, which is further classified day of a week name. For example Sunday, Monday, Tuesday Wednesday, Thursday, Friday Saturday backup schedule will once a week.

Suppose Monday backup schedule run once a week at midnight of every Monday, same away Tuesday backup schedule run once a week at midnight of every Tuesday. If we schedule weekly one day folder end user will have 6 last days folder so that end user can restore the data any point of time.

7 0
3 years ago
Other questions:
  • What is the software called that allows the user to create, access, and manage a database? question 8 options:
    10·1 answer
  • What is the part of the computer system that receives inputs, directs those inputs to the processor, and redirects the processed
    14·1 answer
  • Easy Bib and Cite This For Me are examples of online
    12·1 answer
  • It is necessary tto save updates often when working in google docs? True or false
    11·2 answers
  • Write a program that will open a file named thisFile.txt and write every other line into the file thatFile.txt. Assume the input
    7·1 answer
  • A ______ is a portable device for recording audio and video.
    10·2 answers
  • 7. Which cipher is based on the clues of the physical factors, rather than the hardware or a software cryptosystem
    8·1 answer
  • In order to detect repeated lines anywhere in the input, myuniq must keep track of all of the lines it has seen as it moves thro
    9·1 answer
  • The __________ statement allows you to check for
    7·1 answer
  • The service known as ___ contains original content in the form of live or recorded streams showing individuals playing video gam
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!