Write a program that will accept a Celsius value between -40 degrees and 100 degrees. The...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that will accept a Celsius value between -40 degrees and 100 degrees. The number entered may contain decimal digits. Make these high and low values named constants. Also, make all temperatures floating point numbers and with two decimal digits when displayed. Using a while loop, allow the user to enter the value and if not in range continue to prompt the user for a valid value. Next prompt the user for the number of temperatures to be displayed. In a while loop repeat the following steps: 1. Calculate the Fahrenheit equivalent temperature and Kelvin equivalent temperature. The formulas are: Fahrenheit = 9/5 x Centigrade + 32 Kelvin = Centigrade + 273.15 2. Now display the temperatures in a table format as shown below. The values must be displayed in fixed format with two decimal places. 3. For each iteration of the loop, provide for a temperature increment of 0.5, not just 1. 3. Continue steps 1 and two until the number of temperatures requested is met. 4. In this program you must use the increment operator at least once. The following is a sample run of the completed program. COSC 1550 - Program PGM-06-1 Temperature Conversion Enter the first Celsius temperature between -40 and 100: -200 That temperature not in the valid range, re - enter: 200 That temperature not in the valid range, re enter: 20 Enter the number of temperatures desired: Write a program that will accept a Celsius value between -40 degrees and 100 degrees. The number entered may contain decimal digits. Make these high and low values named constants. Also, make all temperatures floating point numbers and with two decimal digits when displayed. Using a while loop, allow the user to enter the value and if not in range continue to prompt the user for a valid value. Next prompt the user for the number of temperatures to be displayed. In a while loop repeat the following steps: 1. Calculate the Fahrenheit equivalent temperature and Kelvin equivalent temperature. The formulas are: Fahrenheit = 9/5 x Centigrade + 32 Kelvin = Centigrade + 273.15 2. Now display the temperatures in a table format as shown below. The values must be displayed in fixed format with two decimal places. 3. For each iteration of the loop, provide for a temperature increment of 0.5, not just 1. 3. Continue steps 1 and two until the number of temperatures requested is met. 4. In this program you must use the increment operator at least once. The following is a sample run of the completed program. COSC 1550 - Program PGM-06-1 Temperature Conversion Enter the first Celsius temperature between -40 and 100: -200 That temperature not in the valid range, re - enter: 200 That temperature not in the valid range, re enter: 20 Enter the number of temperatures desired:
Expert Answer:
Related Book For
Applied Regression Analysis and Other Multivariable Methods
ISBN: 978-1285051086
5th edition
Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg
Posted Date:
Students also viewed these programming questions
-
One measure of the computer industry's health is final sales. Final sales mean transactions where the purchaser is the end user who is expected to use the computer. Use FRED, the online economic...
-
The pseudocode below has been written as an algorithmic solution to the following programming task but is not complete and may include some incorrect logic. the pseudocode to incorporate all aspects...
-
Jack owns an initial wealth (W0) of $30. Inadvertently, he agreed to enter into the following game : - With 1/4 probability his wealth goes up to $50 - With 1/2 probability his wealth stays the same...
-
Determine the global extreme values of the function on the given domain. f(x, y) = 5x- 3y, y x-2, yz-x-2, y 3
-
The Q factor of a resonance circuit can be defined as the ratio of the voltage across the capacitor (or inductor) to the voltage across the resistor, at resonance. The larger the Q factor, the...
-
How do steroid hormones, derived from cholesterol and encompassing glucocorticoids, mineralocorticoids, and sex steroids, exert their profound effects on gene expression and cellular function through...
-
Explain why your university is considered a system. Give examples of other systems that you know.
-
Compute variances for the following items and indicate whether each variance is favorable (F) or unfavorable (U): Item Budget Actual Varlance For U $400 $360,000 $390 $390.000 Sales price Sales...
-
Jane Corp. had a net profit margin of 6% last year and an equity multiplier of 4.0. If its total assets are $250 million, what is the firm's return on equity? b). Excerpts of The Tree Ltd.'s...
-
McKinney Solvents produces a wide variety of products for the manufacturing industry. The standard mix for producing a single batch of 100 gallons of its biggest-selling product is as follows: There...
-
000 If the market for blue tooth headsets is unregulated and is presently characterized by excess demand (shortage), you can accurately predict that price will increase, the quantity demanded will...
-
Two particles are located on the \(x\) axis of a Cartesian coordinate system. Particle 1 carries a charge of \(+2.0 \mathrm{nC}\) and is at \(x=-30 \mathrm{~mm}\), and particle 2 carries a charge of...
-
Particle 1 carrying charge \(q\) is at the origin of an \(x y\) coordinate system, particle 2 carrying charge \(-2 q\) is at \((1,0)\), and particle 3 carrying charge \(3 q\) is at \((0,1)\). What is...
-
Four negatively charged particles each carry a charge \(q_{\mathrm{n}}\) and form a square of side length \(d\). A positively charged particle carrying a charge \(q_{\mathrm{p}}\) is at the square's...
-
Particle 1 carrying \(-4.0 \mu \mathrm{C}\) of charge is fixed at the origin of an \(x y\) coordinate system, particle 2 carrying \(+6.0 \mu \mathrm{C}\) of charge is located on the \(x\) axis at...
-
You have two marbles, one carrying a uniformly distributed charge \(q_{\mathrm{p}}=+1.0 \mu \mathrm{C}\) and the other carrying a uniformly distributed charge \(q_{\mathrm{n}}=-0.50 \mu \mathrm{C}\)....
-
Observe the skulls of the male and female sea lions. How are the skulls different from each other? Compare the sea lion skulls to the bear skull. How are they similar? Compare (in detail) the skull...
-
In Exercises find dy/dx by implicit differentiation. xy - y = x
-
Consider hypothetical data based on a study concerning the effects of rapid cultural change on blood pressure levels for native citizens of an island in Micronesia. Blood pressures were taken on a...
-
Consider the following computer results, which describe regression analyses involving two independent variables X1 and X2 and a dependent variable Y. Assume that your goal is to assess the...
-
A testing laboratory studies and compares the relationship between tire tread wear per 1,000 miles (Y) and average driving speed (X) for two competing tire types (denoted A and B). The data shown in...
-
On June 3, 2019, Catherine Shanahan received an unsolicited phone call on her cell phone. When she answered, she heard a prerecorded voice message advertising extended automobile warranties (Service...
-
In July 2006, the International Brotherhood of Teamsters, Local Union 25, filed two petitions and held an election for a collective bargaining representative at two FedEx locations. However, FedEx...
-
Miller filed for Chapter 7 bankruptcy protection on April 26, 2013. Based upon the filing date, the period for determining Millers current monthly income was October 1, 2012, through March 31, 2013....
Study smarter with the SolutionInn App