Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3) Write a script that will prompt the user for a temperature in degrees Celsius, and then an 'F' for Fahrenheit or 'K' for Kelvin.

image text in transcribedimage text in transcribed

3) Write a script that will prompt the user for a temperature in degrees Celsius, and then an 'F' for Fahrenheit or 'K' for Kelvin. The script will print the corresponding temperature in the scale specified by the user. For example, the output might look like this: >>Enter the temp in degree C: 29.3 >>Do you want K or F? F. >>The temp in degrees F is 84.7 The format of the output should be exactly as specified above. The conversions are: F =C+32 K = C + 273.15 4) A file called "hightemp.txt" was created some time ago which stores, on every line, a year followed by the high temperature at a specific location for each month of that year. For example, the file might look like this: 89 42 49 55 72 63 68 77 82 76 67 90 45 50 56 5962 68 75 77 75 66 91 44 43 60 60 60 65 69 74 70 70 As can be seen, only two digits were used for the year (which was common in the last century). Write a script that will (1) read this file into a matrix, (2) create a new matrix that stores the years correctly as 19xx, and (3) then write this to a new file called "Year2000.txt. (Hint: add 1900 to the entire first column of the matrix.) Such a file, for example, would look like this: 1989 42 49 55 72 63 68 77 82 76 67 1990 45 50 56 59 62 68 75 77 75 66 1991 44 43 60 60 60 65 69 74 70 70

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

Understand links between the university business model and HRM.

Answered: 1 week ago

Question

One benefit of cloud computing is flexibility. True or False

Answered: 1 week ago