Convert a fahrenheit temperature to celsius

Assignment Help Python Programming
Reference no: EM132354133

Question

You need help with this Python program that can convert a Fahrenheit temperature to Celsius, or vice versa. The program should use two custom functions, f_to_c and c_to_f, to perform the conversions. Both of these functions should be defined in a custom module named temps.

Custom function c_to_f should be a void function defined to take a Celsius temperature as a parameter. It should calculate and print the equivalent Fahrenheit temperature accurate to three decimal places.

Custom function f_to_c should be a value-returning function defined to take a Fahrenheit temperature as a parameter.

This function should calculate the equivalent Celsius temperature and return it. In the main function, your program should:

prompt the user to enter a temperature (as a float type).

indicate the temperature scale of the temperature just entered.

call the appropriate function from the temps module.

if the Celsius temperature is being determined, it should be displayed accurate to three decimal places.

EXAMPLE OUTPUT 1

Enter a temperature 32

Was that input Fahrenheit or Celsius c/f? f

32.0 Fahrenheit equals 0.000 Celsius

EXAMPLE OUTPUT 2

Enter a temperature 100

Was that input Fahrenheit or Celsius c/f? c

100.0 Celsius is 212.000 Fahrenheit

Reference no: EM132354133

Questions Cloud

Define the custom function with three integer parameters : Define the custom function with three integer parameters; one for how many numbers to generate, another for the low value of the range.
Do a real-time structured analysis : ITECH 7410: Software Engineering Methodologies - Real-Time Structured Analysis for the RMT considering the aforementioned steps and the Special Remark
Find out what their vision and mission statements : Please review one or two of your favorite companies and find out what their vision and mission statements are, discuss how they are related to what you learned
Hooking your audience : "Hooking Your Audience", What story or data point are you using to hook and connect with the audience?
Convert a fahrenheit temperature to celsius : Convert a Fahrenheit temperature to Celsius, or vice versa. The program should use two custom functions, f_to_c and c_to_f, to perform the conversions.
Identify the alternate tools available to management : How any potential borrower requesting the same type of credit may manage exposure to interest rate risk? Identify the alternate tools available to management?
Construct a function with the following signature : That is, given two tuples, each containing a pair of floats representing the latitude and longitude of a point on Earth, calculate their Cartesian distance.
Patton uses the term prepon­derance of evidence : Patton uses the term "prepon­derance of evidence" to describe "best fit" between the data a researcher gathers and the patterns and conclusions he or she draws
Simulate compute-client and compute-server interaction : Simulate compute-client and compute-server interaction, you don't have to run them on two physical machines. Instead, they can be run on two JVMs

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd