Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with the following: 1: Metric Conversion Part 1 Create a function called GetCelsius that will take in the temperature in degrees Fahrenheit and

Need help with the following:

1:

image text in transcribedimage text in transcribedimage text in transcribed
Metric Conversion Part 1 Create a function called GetCelsius that will take in the temperature in degrees Fahrenheit and return degrees Celsius. The function needs to accept one parameter to hold the degrees Fahrenheit. The formula you will use is: (Degrees Fahrenheit - 32) x .5556 : Degrees Celsius As an example if it is 50 degrees Fahrenheit outside, when applying the equation above we get (50F 32) x .5556 : 10"C After you perform your calculation convert this value to an integer by using the following code: degreesicelsjus = int(deg1'eesicelsius) There is no output for your function. Simply have the function return the converted value back to where it was called. Given 65 degrees Fahrenheit your program should return 18. Codio will run your function and send in various values in order to test your function. Prior to clicking on the Check It! button, add code to your solution to call your function. Then click on the Try It! button. TRY IT Metric Conversion Pa rt 2 Create a function in Python called GetMeters that will accept feet and convert it to meters. Your function needs to return the number of meters back to where it was called. The equation you will use is: numbeermeters : numbeLijeet * 0.3048 As an example if the function was given 5 feet, when applying the above equation, we would get: 1.524 : 5 * 0.3048 Codio will run your function and send in various values in order to test your function. Prior to clicking on the Check It! button, add code to your solution to call yourfunction. Then click on the Try It! button. TRY IT If your program is not running, click on the Code Visualizer link to run your code line by line. If that still doesn't help, copy the code to either IDLE or VS Code in order to better debug this program. Code Visualizer Before you click on the Check It! button make sure you remove your code that calls your function. OO OO VON UI A W N H #GetCelsius function Collapse Exercises #GetMeters function Metric Conversion Part 3 For this exercise you will get some experience in calling your functions from main(). To start copy and paste the code defining GetCelsius and GetMeters into the file to 12 the right underneath Type your code here. 13 14 #Define main here Next define a main function that will declare 4 variables to hold on the degress 15 Fahrenheit, feet, degrees Celsius and meters. Next you will need to get degrees Fahrenheit and feet from the user using the following prompts: Enter degrees Fahrenheit:_ Enter feet:_ The two _ or underscores you see are representing spaces after the colon (:). Next you will call your two functions and print out those values to the screen. Codio will supply the inputs for degrees Fahrenheit and feet. Your output prompts need to look like the following: Degrees Celsius:_ Meters:_ Where you see __ that represents spaces. Given 87 degrees Fahrenheit and 4 feet, your program should output the following: Degrees Celsius: 30 Meters: 1.2192 If you type in all of your code and you don't see any output, it could be because you did not call main(). At the very bottom of your code type in: main() This will call the main() function and get your program to run. Codio will run your program and send in various values in order to test. Click on the Try It! button to run your program before clicking on the Check It! button. TRY IT If your program is not running, click on the Code Visualizer link to run your code line by line. If that still doesn't help, copy the code to either IDLE or VS Code in order to better debug this program. Code Visualizer

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions