
-----------------------------------
athanaba
Tue Feb 28, 2012 11:56 am

Collecting, Storing and Organizing Data :)
-----------------------------------
Hey guys ! 

I have an assignment which asks me to allow the user to input daily temperatures, and then count and display the number of high, medium and low temperatures.
I know that I'd have to use a loop to ask the user to continually put in temperatures, and if statements for the different categories , but am lost beyond that !
Any help would be appreciated !

Thank youuu :D

Ash

-----------------------------------
bl0ckeduser
Sun Mar 04, 2012 10:22 am

Re: Collecting, Storing and Organizing Data :)
-----------------------------------
Hey guys ! 

I have an assignment which asks me to allow the user to input daily temperatures, and then count and display the number of high, medium and low temperatures.
I know that I'd have to use a loop to ask the user to continually put in temperatures, and if statements for the different categories , but am lost beyond that !
Any help would be appreciated !

Thank youuu :D

Ash

This version compiles high/mid/low temperatures as they are read in:

[code]#include 
#include 

main()
{
	float temp;
	int low = 0, mid = 0, high = 0;

	while(1) {
		scanf("%f", &temp);

		/* break if we reached end of input */
		if(feof(stdin))	break;

		if(temp 