Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this program, you need to redo Prog Assignment 1-5 but using a function. Name your program celsius_to_fahrenheit.py. In your program, define a function c_to_f

image text in transcribedIn this program, you need to redo Prog Assignment 1-5 but using a function. Name your program celsius_to_fahrenheit.py. In your program, define a function c_to_f that has one parameter (degree in Celsius) and returns the degree in Fahrenheit. Celsius and Fahrenheit degrees are related by the formula: celsius * 1.8 = fahrenheit - 32 For each of the following steps, end the program's output with a newline. (1) Prompt the user to input the temperature in degree Celsius, then display the input. (Submit for 1 point). Enter the temperature in Celsius: 22.1 The temperature entered in Celsius is 22.1 (2) Update to output the following. Here you need to define the function, call it from the main, and output the result. (Submit again for 9 more point, so 10 points total). Enter the temperature in Celsius: 22.1 The temperature entered in Celsius is 22.1 The temperature in Fahrenheit is 71.78

Project 2 HI 3 _name File Edit View Navigate Code Refactor Run Tools VCS Window Help Quiz or practice or other venv) po celsius_to_fahrenheit.py celsius_to_fahrenheit (1) 8C a bonus.py Temp\celsius_to_fahrenheit.py venv celsius_to_fahrenheit.py Quiz or practice or other 1. # FIXME: Define the c_to_f function. It should take the degree in Reader Mode venv library root Po bonus.py Gif "_main_": > Milli External Libraries 4 # FIXME: Ask the user to input the degree in Celsius, then output it Scratches and Consoles # Call the c_to_f function in the main. def c_to_f(degree_celsius): degree_fahrenheit = (degree_celsius * 1.8) + 32 return fahrenheit degree_celsius float(input('Enter the temperature in Celsius: ')) degree_fahrenheit = (degree_celsius * 1.8) + 32 print('The temperature entered in Celsius is', degree_celsius) print('The temperature in Fahrenheit is', degree_fahrenheit) 5 A 6 o 7 9 10 11 12 1. Structure * Favorites c_to_f0 if _name__ == main_" Run DE TODO e Problems - Terminal Python Console PyCharm 2020.3.3 available // Update... (42 minutes ago) Event Log 8:26 CRLF UTF-8 4 spaces Python 3.8 (Quiz or practice or other)

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

Students also viewed these Databases questions