
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Use the following: basic input and output, expressions, variables, and assignments, the math and random libraries, expressions, variables, and assignments; mathematical calculations that do not require the use of a library,
Other Python statements cannot be used, e.g. def

Transcribed Image Text:Material
Aluminum
Lead
Coefficient of linear
thermal expansion (x)
23.1
29.0
Coefficient of volumetric
thermal expansion (B)
All output should be rounded to 4 decimal places using the built-in round function. An example
execution of the program is shown below.
Example Executions
What is the initial length of the aluminum beam? 125.4
What is the initial length of the lead beam? 200.34
What is the initial volume of the aluminum beam? 708.3
What is the initial volume of the lead beam? 504.4
What is the starting temp in fahrenheit? 34.9
What is the ending temp in fahrenheit? 86.6
Aluminum beam linear change: 83200.81 meters.
|Lead linear change: 166872.09 meters.
Aluminum volume change: 1403732.55 cubic meters.
Lead volume change: 1260411.5333 cubic meters.
What is the initial length of the aluminum beam? 34.0
What is the initial length of the lead beam? 34.0
What is the initial volume of the aluminum beam? 123.4
What is the initial volume of the lead beam? 432.1
What is the starting temp in fahrenheit? 56.6
What is the ending temp in fahrenheit? 35.0
Aluminum beam linear change: -9424.8 meters.
Lead linear change: -11832.0 meters.
Aluminum volume change: -102175.2 cubic meters.
Lead volume change: -451112.4 cubic meters.
69.0
87.0

Transcribed Image Text:Question 2 (hw2_q2.py): Thermal expansion is the concept of physical materials changing
their shape as a result of temperature changes. For example, when we build bridges, we need
to include expansion joints in the road, thereby allowing the expansion and contraction of the
road due to changes in temperature. In fact, the change can be in terms of density, area,
volume and shape. For this problem we will focus on the linear change to a metal based on a
change in temperature.
Linear thermal expansion occurs in one axis or direction (hence the name). Here, the change in
length (denoted by AL) is proportional to the material's coefficient of linear expansion (α), the
original length of the material (L), and the change in the temperature (AT). It can be expressed
with the following equation:
0
Similarly, volumetric thermal expansion can occur when the material expands or contracts in all
directions. The change in volume (AV) is is proportional to the material's coefficient of volumetric
expansion (B), the original volume of the material (V), and the change in the temperature (AT).
It can be expressed with the following equation:
●
AL = *
α
●
●
* AT
*
AV = В V
0
Write a Python program that prompts the user to enter each of the following:
the original length of an aluminum beam (float),
the original length of a lead beam (float),
the current temperature in fahrenheit (float), and
● the ending temperature in fahrenheit (float)
* AT
Once entered, calculate the change in length and volume of both beams due to thermal
expansion. Your output should include printing both the change amounts and the new values
(new length, new volume) (see sample executions below). Note that the input lengths must be in
terms of meters, and the input temperatures must be entered in terms of fahrenheit.
The calculations are in terms of celsius, so your program will be required to convert the user
input from fahrenheit to celsius (and also to convert the amount of the temperature change). You
are required to investigate the correct formula for the conversion of a temperature from
fahrenheit to celsius to include in your program.
Note the following coefficients for linear and volumetric expansion for both aluminum and lead.
These values are constant and should be represented in your program as constants.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
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
- Use the following: basic input and output, expressions, variables, and assignments, the math and random libraries, expressions, variables, and assignments; mathematical calculations that do not require the use of a library, Other Python statements cannot be used, e.g. defarrow_forwardOne of the benefits of computers is that they can be programmed to do a specific task. Which of the following statements is correct?arrow_forward# Debug the following program and submit the CORRECT version ####### Lists names = ["chris","dan", "edgar", "bonnie", "al", "fran"] usernames = ["202999", "100345", "299999", "309890", "298765", "345678"] passwords = ["password", "password123", "abcdef", "asdfjkl;", "ilovemom", "abc123"] menuChoice = 0 # user's menu choice ###### functions def printList(list):# print listprintprint(list)print def displayMenu():# displays user-friendly, creative menu printprintprint("******* MENU *******")print("1. (D)isplay list 1 in original order")print("2. D(I)splay list 2 in original order")print("3. (F)ind an item in the list 1")print("4. (L)ogin")print("99. (E)xit")printprint def isFound(list, value):# finds a value in list returns True if found, False otherwiseif (value in list):return Trueelse: return False ###### main program while (menuChoice != "99"):displayMenu()menuChoice = input("Enter a menu choice: ")# handling menu choices if (menuChoice == "10" or menuChoice.upper().strip() ==…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education