The temperature utility module file has the following code. def CtoF(temp): '''Convert Celsius temperature to Fahrenheit temperature''' return 9 / 5 * temp + 32 def FtoC(temp): '''Convert Fahrenheit temperature to Celsius temperature''' return 5 / 9 * (temp - 32) def CtoK(temp): '''Convert Celsius temperature to Kelvin temperature''' return temp + 273.15 def KtoC(temp): '''Convert Kelvin temperature to Celsius temperature''' return temp - 273.15 The utility.py module is uploaded to zyBook. Write a program that imports the utility module. Using the utility module, write two functions called FtoK() and KtoF() as shown below. def FtoK(tempF) where tempF is Fahrenheit temperature. def KtoF(tempK) where tempK is Kelvin temperature. The temperature program reads two inputs. The first input is Fahrenheit temperature and the second input is Kelvin temperature. It displays the corresponding Kelvin temperature and Fahrenheit temperature. For example, if the user input is: 212 273.15 the output is: 373.15 32.0 You must use the functions found in the utility module. I have an error message saying that the FtoK utility has no attribute, I need some clarification on how it has no attribute when the function has been defined.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

The temperature utility module file has the following code.

def CtoF(temp): '''Convert Celsius temperature to Fahrenheit temperature''' return 9 / 5 * temp + 32 def FtoC(temp): '''Convert Fahrenheit temperature to Celsius temperature''' return 5 / 9 * (temp - 32) def CtoK(temp): '''Convert Celsius temperature to Kelvin temperature''' return temp + 273.15 def KtoC(temp): '''Convert Kelvin temperature to Celsius temperature''' return temp - 273.15

The utility.py module is uploaded to zyBook. Write a program that imports the utility module. Using the utility module, write two functions called FtoK() and KtoF() as shown below.

def FtoK(tempF)

where tempF is Fahrenheit temperature.

def KtoF(tempK)

where tempK is Kelvin temperature.

The temperature program reads two inputs. The first input is Fahrenheit temperature and the second input is Kelvin temperature. It displays the corresponding Kelvin temperature and Fahrenheit temperature. For example, if the user input is:

212 273.15

the output is:

373.15 32.0

You must use the functions found in the utility module.

I have an error message saying that the FtoK utility has no attribute, I need some clarification on how it has no attribute when the function has been defined. 

1 # Define your function here
2 import utility
3
4 def FtoK(tempF):
return tempF + 273.15
6.
7 def KtoF(tempK):
return tempK - 273.15
9 if
_main_':
name
# Type your code here.
tempF = float(input())
tempk = float(input ())
10
11
12
13
tempF = utility.FtoK (tempF)
tempk = utility.KtoF(tempK)
14
15
16
print('{:.2f}'.format(tempF))
print ('{:.1f}'.format (tempk))
17
18
Transcribed Image Text:1 # Define your function here 2 import utility 3 4 def FtoK(tempF): return tempF + 273.15 6. 7 def KtoF(tempK): return tempK - 273.15 9 if _main_': name # Type your code here. tempF = float(input()) tempk = float(input ()) 10 11 12 13 tempF = utility.FtoK (tempF) tempk = utility.KtoF(tempK) 14 15 16 print('{:.2f}'.format(tempF)) print ('{:.1f}'.format (tempk)) 17 18
Program errors displayed here
Traceback (most recent call last):
File "main.py", line 14, in <module>
tempF = utility.FtoK (tempF)
AttributeError: module 'utility' has no attribute 'FtoK'
Transcribed Image Text:Program errors displayed here Traceback (most recent call last): File "main.py", line 14, in <module> tempF = utility.FtoK (tempF) AttributeError: module 'utility' has no attribute 'FtoK'
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education