Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this portion of the lab, you must reuse the program you wrote in Lab4A (Lab FOUR part A ). This means ALL requirements for

For this portion of the lab, you must reuse the program you wrote in Lab4A (Lab FOUR part A). This means ALL requirements for Lab 4 are also required for this lab, so if you had errors in Lab4 you must correct them in order to complete this assignment. Redesign the solution in the following manner.

Ask the user for their name and their email addresses before you display the results of the conversions.

When the user enters their email address search the string for the @ symbol. If the symbol is not found, ask the user to re-enter their email address till they get it right.

When you display the conversion output to the user, you must include the users name in the output.

CODE from Lab 4 is below/please show proper indentation

##########################

#This program will convert various mesaurements into the metric system.

print('Welcome to the converter program!')

#Conversion of miles to km counter = 0 miles = float(input('William, how many miles do you want to convert to kilometers? ')) while miles < 0: print("'ERROR - Negative Value [ENDING PROGRAM]") miles = float(input("Enter the correct value for miles ")) counter+=1 if counter > 2: break if counter <= 2: kilometers= miles * 1.6 print("The distance in kilometers is: ", kilometers) else: print("Exceeded error count")

#Conversion of F to C counter1 = 0 fahrenheit = float(input('William, what degrees fahrenheit do you want to convert to celsius? ')) while fahrenheit < 0: print("'ERROR - Negative Value [ENDING PROGRAM]") fahrenheit = float(input("Enter the correct value for fahrenheit ")) counter1+=1 if counter1 > 2: break if counter1 <= 2: celsius = (fahrenheit - 32) * 5/9 print("The degrees in celsius is: ", celsius) else: print("Exceeded error count")

#Conversion of Gallons to Liters counter2 = 0 gallons = float(input('William, how many gallons do you want to convert to liters? ')) while gallons < 0: print("'ERROR - Negative Value [ENDING PROGRAM]") gallons = float(input("Enter the correct value for gallons ")) counter2+=1 if counter2 > 2: break if counter2 <= 2: liters = gallons * 3.9 print("The amount in liters is: ", liters) else: print("Exceeded error count")

#Conversion of Pound to Kg counter3 = 0 pounds = float(input('William, how many pounds do you want to convert to kilograms? ')) while pounds < 0: print("'ERROR - Negative Value [ENDING PROGRAM]") pounds = float(input("Enter the correct value for pounds ")) counter3+=1 if counter3 > 2: break if counter3 <= 2: kilograms = pounds * 0.45 print("The weight in kilograms is: ", kilograms) else: print("Exceeded error count")

#Conversion of Inches to cm counter4 = 0 inches = float(input('William, how many inches do you want to convert to centimeters? ')) while inches < 0: print("'ERROR - Negative Value [ENDING PROGRAM]") inches = float(input("Enter the correct value for miles ")) counter4+=1 if counter4 > 2: break if counter4 <= 2: centimeters = inches * 2.54 print("The distance in centimeters is: ", centimeters) else: print("Exceeded error count")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions