help with in/ou files

Write your question here.
I am stuck with this program
this is the problem:
Write a program that will ask user to enter in the temperature in Celsius and write the data to a file. Program will give user option to 1) add more data 2) create a report which will show temps in Celsius and Fahrenheit. Report will also show the Average Temp in both C and F and the Standard Deviation again in both C and F.

this is what I have so far and I do not even know how to fix it.
thank you in advance ...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

 #include <iostream>
 #include <fstream>       // Needed to use files
 #include <iomanip>
 #include <string>
 #include <cmath>


 using namespace std;

int main(void) 
{  		
        int   arraysize=365,
              choice,
 		       number_temp=0;
 		double temp[arraysize],
 		  		  average=0,
				  celsius,
				  fahrenheit = 0 ,
				  sum = 0 ,
				  standard_deviation = 0 ;
               
		
		
		ifstream in_temps;
		ofstream out_temps;

	do
	{
	//menue
		
		cout << "\t 1 Enter temperatures " << endl ;
		cout << "\t 2 Enter Create report " << endl ;
		cout << "\t 3 Enter to quit " << endl ; 
		cout << "\t Enter Option: " ;
		cin >> choice ;
		
		system (" cls ") ;
			switch(choice)
		{	case 1:
			
		{
		
		out_temps.open("d:temp_data.txt",ios::app) ;
			    
    	
       }
       
       out_temps.close() ; 
       break ;
       
       case 2 : 
	   {in_temps.open("d:Temperature.txt");//reading data
      			if(in_temps) //checks valid file
       			 {      
            		 while( in_temps >> temp[arraysize]) // will read while not EOF is read
             		 { 
                 	   celsius+=temp[arraysize];
                  	   arraysize++;
             		 }
       			  }
       		 	else
       				cout<<"error reading";
       }
	   
	   in_temps.close();
	   break ;
	}
				
		
	 

      
    }while(choice !=3);
    
return 0 ;
}
  Put the code you need help with here.
Hey we have the same program form my ENG 120C class, have you figured this one out? Im basically stuck with that code too
Topic archived. No new replies allowed.