answersLogoWhite

0


Best Answer

#include<iostream>

double celsius(double fahrenheit) { return((fahrenheit-32)*5/9); }

double fahrenheit(double celsius) { return(celsius*9/5+32); }

int main()

{

double f, c;

c = celsius( 32.0); // c 212.0

return(0);

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

Firstly, you will need some way of collecting the temperature at regular time intervals. The simplest solution would be to automate the collection of data with an electronic thermometer, but as a homework project you can simply input the data manually. Ultimately, the shorter the interval, the more accurate the results will be.

Data will need to be stored in non-volatile memory to be recalled at any time, so you will need to store the data in a file, with perhaps one file for each 24-hour period. A database would be a better option if you have a large amount of data to analyse.

Since the same interval will be used daily, a static array can be employed to analyse the results for each day. Once the required data is loaded into the array, you will determine the daily average from the sum of all the temperatures in the array divided by the number of elements. For instance, if you collected temperatures once per hour, you will have an array of 24 elements for the day. Add up all 24 elements and then divide by 24 to determine the average temperature. To compare several days you might employ several separate arrays or a two-dimensional array, where the rows represent the day and the columns represent the hours, thus allowing an hour-by-hour comparison over several days.

Ultimately, analysing the data is not the crux of the problem. The real problem is in collecting, storing and retrieving the data.

This answer is:
User Avatar

User Avatar

Wiki User

6y ago

double celsius_to_fahrenheit (double celsius) {return celsius * 9 / 5 + 32;}

double fahrenheit_to_celsius (double fahrenheit) {return (fahrenheit - 32) * 5 / 9;}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How write a program that display today temperatures and their average in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the coldest country today?

Russia and Canada's northernly average temperatures are about the same, which makes them the coldest countries.


What was the default rate on the Cash for Clunkers program?

According to USA Today, 4.8%, more than twice the average rate.


What had happened to global average temperatures over the past 200 years?

The earth's average temperature in 1900-1909 was 56.58 degrees Fahrenheit.


What is the duration of Today NBC program?

The duration of Today - NBC program - is 3.2 hours.


When was Today - NBC program - created?

Today - NBC program - was created on 1952-01-14.


Can a d making student become a nurse?

Nursing program today are competitive. Thus, you really need to raise that grade point average.


Convert 100 pounds in 1880 to today?

The conversion program I used comes up with an average of 11,800pounds. The range is from 8,000 to a high of 16400.


What is the duration of Weekend Today Australian TV program?

The duration of Weekend Today - Australian TV program - is 2 hours.


What do thermometers to do today?

The same as they've always done, they measure temperatures.


Where is tom landry's hat today?

on display at the football hall of fame.


When was Weekend Today - Australian TV program - created?

Weekend Today - Australian TV program - was created on 2009-02-01.


What did the temperature drop by in the ice age?

average global temperature, about 5C lower than today. local temperatures in some places fell far more, while a few areas warmed some.