0% found this document useful (0 votes)
5 views1 page

Weather Program for Temperature Analysis

The document outlines a program named 'weather' that prompts the user to input maximum and minimum temperatures. It calculates the average temperature and heat index based on the provided values. The program then displays a weather report including the maximum temperature, minimum temperature, average temperature, and heat index.

Uploaded by

shaheed mohammed
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Weather Program for Temperature Analysis

The document outlines a program named 'weather' that prompts the user to input maximum and minimum temperatures. It calculates the average temperature and heat index based on the provided values. The program then displays a weather report including the maximum temperature, minimum temperature, average temperature, and heat index.

Uploaded by

shaheed mohammed
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Question:

Write a program named weather which does the following:

Asks the user to enter the maximum temperature and minimum temperature.

Calculates the average temperature and heat index

Average = (minimum + maximum)/2

Heat index = average * 4.5

Display the following: “TV9 Weather report”

Maximum Temperature

Minimum Temperature

Average temperature

Heat index

Solution
program weather;

uses crt;

var

max, min, avg, heat : real;

begin

clrscr;

writeln('Please enter maximum temperature');

readln(max);

writeln('Please enter minimum temperature');

readln(min);

avg:= (max + min)/2;

heat:= avg*4.5;

writeln('TV9 Weather Report');

writeln('Maximum Temperature:',max:0:1);

writeln('Maximum Temperature:',min:0:1);

writeln('Average Temperature:',avg:0:1);

writeln('Heat Index:',heat:0:1);

readln();

End.

You might also like