Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

FORTRAN 90. The above images show how the code (lab5) should work. The programing language is Fortran 90. And here is the code for lab04.f90:

FORTRAN 90.

image text in transcribedimage text in transcribed

The above images show how the code (lab5) should work. The programing language is Fortran 90. And here is the code for lab04.f90:

program Lab04 implicit none real,dimension (:,:), allocatable::table ! maximum array real::start_temp,stop_temp, increment logical::check integer::m,i,S(2) check=.true. do while (check) print*,'enter the starting and ending temperatures & &of your table (separate with a comma)' read(*,*) start_temp,stop_temp if ((start_temp > 200.0 .OR. start_temp 200.0 .OR. stop_temp stop_temp) then start_temp=start_temp+stop_temp stop_temp=start_temp-stop_temp start_temp=start_temp-stop_temp end if do while (check) print*,'enter the increment of your table, a value between 1 and', abs(start_temp-stop_temp) read(*,*) increment if (increment >= 1.0 .and. increment Use of formatting and input/output files Modify Lab04.890 so that it: askes the user to enter his/er first name and last name via key board entry (maximum 20 characters). . ask user to enter the following values Start temp. in C (Code should check if it is between 10 to 210. if not, askes the user to enter a new value) Stop temp. inC code should check if it is between -10 to 210. if not, askes the user to enter a new value) o Temp. Increment in C (Code should check if it is less than stop temp. - start temp.). if not, askes the user to enter a new value) allocate a matrix (with appropriate size) as the conversion table. assigns the element of the matrix, column by column (the first column C, the second column F, and the third column) creates a text file following the user first name and last name as: PirstName_LastName.txt writes on the created file the following information: 1- A description of the table such as: This table converts start-temp. to stop-temp. Celsius to Fahrenheit and Kelvin This table has i number of rows and j number of columns Note that: in above string start-temp. and stop-temp. should be represented as a real number with two decimal digits, and i andj should be represented as integer numbers. 2- Provide a header for the table such as: Centigrade Fahrenheit Kelvin 3- Prints the table. Note that the output should be represented as real numbers with two decimal digits Hint: Below is an example of what should be seen on screen by Lab04.190 execution. The output file of this execution is attached. Enter your first name (single word maximum 20 characters) John Enter your last name (single word maximum 20 characters) Smith enter the lower and upper temperature limit of your table (separate with a comma) -8.5,160.5 enter the increment of your table, a value between 1 and 169.000000 2.5 This table converts -8.50 to 160.50Celsius is converted to Fahrenheit and Kelvin Your table has 68 rows, and 3 columns Centigrade Fahrenheit Kelvin -8.50 16.70 264.65 -6.00 21.20 267.15 -3.50 25.70 269.65 -1.00 30.20 272.15 1.50 34.70 274.65 4.00 39.20 277.15 6.50 43.70 279.65 9.00 48.20 282.15 11.50 52.70 284.65 14.00 57.20 287.15 16.50 61.70 289.65 19.00 66.20 292.15 21.50 70.70 294.65 24.00 75.20 297.15 26.50 79.70 299.65 29.00 84.20 302.15 31.50 88.70 304.65 34.00 93.20 307.15 36.50 97.70 309.65 39.00 102.20 312.15 41.50 106.70 314.65 44.00 111.20 317.15 46.50 115.70 319.65 49.00 120.20 322.15 51.50 124.70 324.65 54.00 129.20 327.15 56.50 133.70 329.65 59.00 138.20 332.15 61.50 142.70 334.65 64.00 147.20 337.15 66.50 151.70 339.65 69 An 156 2A 312 15 Use of formatting and input/output files Modify Lab04.890 so that it: askes the user to enter his/er first name and last name via key board entry (maximum 20 characters). . ask user to enter the following values Start temp. in C (Code should check if it is between 10 to 210. if not, askes the user to enter a new value) Stop temp. inC code should check if it is between -10 to 210. if not, askes the user to enter a new value) o Temp. Increment in C (Code should check if it is less than stop temp. - start temp.). if not, askes the user to enter a new value) allocate a matrix (with appropriate size) as the conversion table. assigns the element of the matrix, column by column (the first column C, the second column F, and the third column) creates a text file following the user first name and last name as: PirstName_LastName.txt writes on the created file the following information: 1- A description of the table such as: This table converts start-temp. to stop-temp. Celsius to Fahrenheit and Kelvin This table has i number of rows and j number of columns Note that: in above string start-temp. and stop-temp. should be represented as a real number with two decimal digits, and i andj should be represented as integer numbers. 2- Provide a header for the table such as: Centigrade Fahrenheit Kelvin 3- Prints the table. Note that the output should be represented as real numbers with two decimal digits Hint: Below is an example of what should be seen on screen by Lab04.190 execution. The output file of this execution is attached. Enter your first name (single word maximum 20 characters) John Enter your last name (single word maximum 20 characters) Smith enter the lower and upper temperature limit of your table (separate with a comma) -8.5,160.5 enter the increment of your table, a value between 1 and 169.000000 2.5 This table converts -8.50 to 160.50Celsius is converted to Fahrenheit and Kelvin Your table has 68 rows, and 3 columns Centigrade Fahrenheit Kelvin -8.50 16.70 264.65 -6.00 21.20 267.15 -3.50 25.70 269.65 -1.00 30.20 272.15 1.50 34.70 274.65 4.00 39.20 277.15 6.50 43.70 279.65 9.00 48.20 282.15 11.50 52.70 284.65 14.00 57.20 287.15 16.50 61.70 289.65 19.00 66.20 292.15 21.50 70.70 294.65 24.00 75.20 297.15 26.50 79.70 299.65 29.00 84.20 302.15 31.50 88.70 304.65 34.00 93.20 307.15 36.50 97.70 309.65 39.00 102.20 312.15 41.50 106.70 314.65 44.00 111.20 317.15 46.50 115.70 319.65 49.00 120.20 322.15 51.50 124.70 324.65 54.00 129.20 327.15 56.50 133.70 329.65 59.00 138.20 332.15 61.50 142.70 334.65 64.00 147.20 337.15 66.50 151.70 339.65 69 An 156 2A 312 15

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

Step: 3

blur-text-image

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

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago