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

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

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

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: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
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.
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
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Literals
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
  • SEE MORE 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