Create a program with the following functions (remember to define the functions before calling them): 1....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a program with the following functions (remember to define the functions before calling them): 1. Fahrenheit to Celsius - fahr2Celsius(fahr_temp) a. Argument - temperature in Fahrenheit b. Return value - temperature in Celsius Formula: (Fahrenheit - 32) * 5/9 2. Celsius to Fahrenheit - cels2Fahrenheit(cels_temp) a. Argument - temperature in Celsius b. Return value - temperature in Fahrenheit Formula: (9/5) * Celsius temp + 32. Program steps: 1. Input and processing: a. Prompt the user for the type of temperature conversion to make and determine which function to call: C (fahrenheit to celsius), F (celsius to fahrenheit) Note: See the screen shots below for examples of program input and output i. For an input of C (fahrenheit to celsius) 1. Prompt the user for the fahrenheit temperature to convert 2. Call the fahr2Celsius function passing as an argument the fahrenheit temperature entered ii. For an input of F (celsius to fahrenheit) 1. Prompt the user for the celsius temperature to convert 2. Call the cels2Fahrenheit function passing as an argument the celsius temperature entered b. Store the converted temperature value returned from the called function (use in step 2 below) 2. Output: a. Fahrenheit to celsius: The Fahrenheit temperature and the Celsius temperature must be formatted with one decimal place using one of the string formatting techniques, str.format() or f-string, and displayed like the screenshots below. Convert temperatures between fahrenheit and celsius Enter C for fahrenheit to Celsius, Enter F for celsius to fahrenheit: C Enter the Fahrenheit temperature: 68 68.0 degrees Fahrenheit converted to celsius is: 20.0 degrees Celsius. Convert temperatures between fahrenheit and celsius Enter C for fahrenheit to Celsius, Enter F for celsius to fahrenheit: C Enter the Fahrenheit temperature: 72.9 72.9 degrees Fahrenheit converted to celsius is: 22.7 degrees Celsius. b. Celsius to fahrenheit: The Celsius temperature and the Fahrenheit temperature must be formatted with one decimal place using one of the string formatting techniques, str.format() or f-string, and displayed like the screenshots below. Convert temperatures between fahrenheit and celsius Enter C for fahrenheit to Celsius, Enter F for celsius to fahrenheit: F Enter the Celsius temperature to convert: 2e 20.0 degrees celsius converted to fahrenheit is: 68.0 degrees fahrenheit. Convert temperatures between fahrenheit and celsius Enter C for fahrenheit to Celsius, Enter F for celsius to fahrenheit: F Enter the Celsius temperature to convert: 23.8 23.8 degrees celsius converted to fahrenheit is: 74.8 degrees fahrenheit. Create a program with the following functions (remember to define the functions before calling them): 1. Fahrenheit to Celsius - fahr2Celsius(fahr_temp) a. Argument - temperature in Fahrenheit b. Return value - temperature in Celsius Formula: (Fahrenheit - 32) * 5/9 2. Celsius to Fahrenheit - cels2Fahrenheit(cels_temp) a. Argument - temperature in Celsius b. Return value - temperature in Fahrenheit Formula: (9/5) * Celsius temp + 32. Program steps: 1. Input and processing: a. Prompt the user for the type of temperature conversion to make and determine which function to call: C (fahrenheit to celsius), F (celsius to fahrenheit) Note: See the screen shots below for examples of program input and output i. For an input of C (fahrenheit to celsius) 1. Prompt the user for the fahrenheit temperature to convert 2. Call the fahr2Celsius function passing as an argument the fahrenheit temperature entered ii. For an input of F (celsius to fahrenheit) 1. Prompt the user for the celsius temperature to convert 2. Call the cels2Fahrenheit function passing as an argument the celsius temperature entered b. Store the converted temperature value returned from the called function (use in step 2 below) 2. Output: a. Fahrenheit to celsius: The Fahrenheit temperature and the Celsius temperature must be formatted with one decimal place using one of the string formatting techniques, str.format() or f-string, and displayed like the screenshots below. Convert temperatures between fahrenheit and celsius Enter C for fahrenheit to Celsius, Enter F for celsius to fahrenheit: C Enter the Fahrenheit temperature: 68 68.0 degrees Fahrenheit converted to celsius is: 20.0 degrees Celsius. Convert temperatures between fahrenheit and celsius Enter C for fahrenheit to Celsius, Enter F for celsius to fahrenheit: C Enter the Fahrenheit temperature: 72.9 72.9 degrees Fahrenheit converted to celsius is: 22.7 degrees Celsius. b. Celsius to fahrenheit: The Celsius temperature and the Fahrenheit temperature must be formatted with one decimal place using one of the string formatting techniques, str.format() or f-string, and displayed like the screenshots below. Convert temperatures between fahrenheit and celsius Enter C for fahrenheit to Celsius, Enter F for celsius to fahrenheit: F Enter the Celsius temperature to convert: 2e 20.0 degrees celsius converted to fahrenheit is: 68.0 degrees fahrenheit. Convert temperatures between fahrenheit and celsius Enter C for fahrenheit to Celsius, Enter F for celsius to fahrenheit: F Enter the Celsius temperature to convert: 23.8 23.8 degrees celsius converted to fahrenheit is: 74.8 degrees fahrenheit.
Expert Answer:
Answer rating: 100% (QA)
Code def tofehrctemp return 18ctemp32 def tocelsftem... View the full answer
Related Book For
Digital Design and Computer Architecture
ISBN: 978-0123944245
2nd edition
Authors: David Harris, Sarah Harris
Posted Date:
Students also viewed these computer engineering questions
-
Suppose you are running a program with the following data access pattern. The pattern is executed only once. 0x0 0x8 0x10 0x18 0x20 0x28 (a) If you use a direct mapped cache with a cache size of 1 KB...
-
Use Neville's method to approximate3 with the following functions and values. a. f (x) = 3x and the values x0 = 2, x1 = 1, x2 = 0, x3 = 1, and x4 = 2. b. f (x) =x and the values x0 = 0, x1 = 1, x2 =...
-
Find all the inverses associated with the following functions and state their domains. f(x) = (x + 1) 3
-
Given the observed yields below, what is the 1-year forward rate, 4 years from now? [Hint: This is the 1-year return that will take you from the 4-year average annualized return (yield) to the 5-year...
-
The IT manager of Aztec Realty, Inc. prepared the statement of financial position of the company while the accountant was ill. The statement of financial position contains numerous errors. In...
-
Consider again Worked-Out Problem 8.6 (page 271) but assume that a unit of capital costs $1,000 per week and that Hannah and Sam are initially remodeling 200 square feet per week. What are the...
-
Reconsider Example 2.20. The conditional probability that a high level of contamination was present when a failure occurred is to be determined. The information from Example 2.20 is summarized here....
-
What are the likely reasons and rationalizations Matt will give for making the payments discussed in the case?
-
The Exchange Rate Volatility (ERV) and Trade Balance (TB) relationship by using monthly data over the period January 2010 to December 2019 and a nonlinear regression model, namely the Nonlinear...
-
Assume a company has only one service department and one operating department. The service departments budgeted and actual variable costs for the period were $80,000 and $84,000, respectively. The...
-
Write a C++ program that inputs the length and width of two rectangles (in integers) representing a house and a garage. Write a function that uses Call-by- Value int rectArea (int len, int wid) that...
-
1. What does a double solid white line on the roadway indicate? a) Traffic traveling in opposite directions and passing is prohibited b) Traffic traveling in the same direction and passing is...
-
how can we promote fairer and more sustainable labor practices ( especially remuneration ) in the global fashion industry?
-
Most countries in the world are classified as _ _ _ _ nations. 1 . least developed 2 . working 3 . industrialized 4 . developing
-
Suppose that Walmart is planning an Internet subsidiary to compete head - to head with Amazon. Walmart argues that it can compete aggressively in Internet retailing because Walmart has a low beta and...
-
With reference to the Sale of Goods Act 1 9 5 7 and decided cases, explain the implied terms of the contract of sale of goods.
-
On June 3, 2023, Kitty Wilkinson received a bank statement from the bank for the month of May which showed an overdrawn balance of $700, it was also noted that there was a debit balance of $3,450 in...
-
Find a least expensive route, in monthly lease charges, between the pairs of computer centers in Exercise 11 using the lease charges given in Figure 2. a) Boston and Los Angeles b) New York and San...
-
Ben Bitdiddle is building a house. Explain how he can use the principles of hierarchy, modularity, and regularity to save time and money during construction.
-
Write an HDL module for the traffic light controller from Section 3.4.1.
-
An N-bit Johnson counter consists of an N-bit shift register with a reset signal. The output of the shift register (S out ) is inverted and fed back to the input (S in ). When the counter is reset,...
-
Determine the most appropriate strategy that can generate liquidity and accomplish Omos goals. Justify your response. Jing asks Omo about his plans for the shares of his previous employers company....
-
Discuss four important risk and tax-related considerations that are relevant to Omos portfolio. With most of Omos personal net worth tied up in his software company, he is asset rich but cash poor....
-
Recommend, for both Enlows niece and nephew, the most tax-efficient wealth transfer option (lifetime gift or testamentary bequest). Show your calculations. Recommend, for both Enlow's niece and...
Study smarter with the SolutionInn App