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
List and describe the 3 tasks learners can do in a Technology classroom.
Anna11 [10]

The 3 tasks learners can do in a Technology classroom.

1. Telling digital stories .

2. Filming tasks on mobile phones .

3. Making lists of things done.

<h3>What are the three roles of technology for learners?</h3>

Technology is known to be a tool that often gives a lot of students a kind of an easy-to-access to any kind of  information, as well as an accelerated learning, and others that the student can use to learn.

Note that this helps students to look inro new subjects and have a wider understanding of difficult topics.

Hence, The 3 tasks learners can do in a Technology classroom.

1. Telling digital stories .

2. Filming tasks on mobile phones .

3. Making lists of things done.

Learn more about Technology from

brainly.com/question/25110079

#SPJ1

3 0
1 year ago
85 points!!!!!!!!!!!!!!! is creating a résumé. Which parts of her résumé has she done correctly?
Ket [755]

Answer:

Decorative font, because having a fancy font on a resume is not going to be looked at

5 0
2 years ago
ou need to implement a wireless network link between two buildings on a college campus. A wired network has already been impleme
ICE Princess25 [194]

Answer:

High-gain and directional wireless antenna.

Explanation:

WiFi can be defined as a wireless local area network that allows network devices such as access points (APs), computers (both laptops and desktops), smartphones, smart televisions, etc., to communicate with each other wirelessly over a short-ranged network. It is a standard communication network that uses radio waves to establish a channel (medium) between multiple network devices.

This ultimately implies that, the network range or distance covered by WiFi is largely dependent on transmission power and frequency. Generally, the standard range or distance covered by WiFi is about 50 meters (160 feet).

Electromagnetic waves is a propagating medium used in all communications device to transmit data (messages) from the device of the sender to the device of the receiver through the use of an antenna.

In this scenario, you need to implement a wireless network link between two buildings on a college campus, which are 100 meters apart.

A high-gain antenna is an electromagnetic device that typically has a gain rating of 12dBi or sometimes higher. Also, a highly directional antenna can only receive radio signals from a specific direction and it compresses the radio waves that are being transmitted from a sender in to a very narrow beam.

Hence, the two (2) type of wireless antenna you should use on each side of the link are a high-gain antenna and a directional wireless antenna.

4 0
3 years ago
How to get the pc accelerate pro virus off my computer
garik1379 [7]
Try to see a computer specialist to help
4 0
2 years ago
Read 2 more answers
There is no way for multiple buttons to be displayed next to each other in a horizontal arrangement in App Inventor.
Mamont248 [21]

Answer:

true

Explanation:

6 0
1 year ago
Other questions:
  • A point is named by a lowercase letter. <br> a. True<br> b. False
    11·2 answers
  • How could the provisions in the new health reform bill improve access to care?
    14·1 answer
  • If a student is looking for the degree symbol (°) and it is not found on the main drop-down of symbols, what should the student
    9·2 answers
  • What are the basic tools for coding HTML manually?
    9·2 answers
  • The number of bits per pixel is called what
    7·1 answer
  • Which of the following is NOT considered a step in the problem solving process. A Try B Discover C Prepare D Define
    12·1 answer
  • What are some characteristics of filtering junk email in Outlook 2016? Check all that apply.
    10·2 answers
  • An example of computer hardware is ? A. keyboard B. app C. web browser D. operating system
    13·2 answers
  • Noah is creating a startup. He uses the website Upwork to hire freelancers in India and in the Ukraine to work for him. This is
    8·1 answer
  • What are the different types of topology?​ in details
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!