Ask Experts Questions for FREE Help !
Ask
    willwill's Avatar
    willwill Posts: 4, Reputation: 1
    New Member
     
    #1

    May 17, 2008, 06:13 PM
    Can anyone make this program run?
    #include “stdafx.h”

    #include <iostream>

    #include <ofstream>

    #include " "


    using namespace std;



    void main()

    {

    float degrees[12];

    float diff[12];

    float sum;

    float average;

    int I;



    ofstream outData;




    outData.Open(“tempdata.dat”);



    cout<<”Input first temperature “;

    cin >> degrees[0];



    cout<<”Input first temperature “;

    cin >> degrees[0];

    cout<<”Input second temperature “;

    cin >> degrees[1];

    cout<<”Input third temperature “;

    cin >> degrees[2];

    cout<<”Input fourth temperature “;

    cin >> degrees[3];

    cout<<”Input fifth temperature “;

    cin >> degrees[4];

    cout<<”Input sixth temperature “;

    cin >> degrees[5];

    cout<<”Input seventh temperature “;

    cin >> degrees[6];

    cout<<”Input eightth temperature “;

    cin >> degrees[7];

    cout<<”Input ninth temperature “;

    cin >> degrees[8];

    cout<<”Input tenth temperature “;

    cin >> degrees[9];

    cout<<”Input eleventh temperature “;

    cin >> degrees[10];

    cout<<”Input twelveth temperature “;

    cin >> degrees[11];



    diff[1] = degrees[1] – degrees[0];

    diff[2] = degrees[2] – degrees[1];

    diff[3] = degrees[3] – degrees[2];

    diff[4] = degrees[4] – degrees[3];

    diff[5] = degrees[5] – degrees[4];

    diff[6] = degrees[6] – degrees[5];

    diff[7] = degrees[7] – degrees[8];

    diff[8] = degrees[8] – degrees[7];

    diff[9] = degrees[9] – degrees[8];

    diff[10] = degrees[10] – degrees[9];

    diff[11] = degrees[11] – degrees[10];



    outData<<degrees[0] <<endl<<degrees[1]<<diff[1]<<endl<<degrees[2]<<diff[2]<<endl’;

    outData<<degrees[3]<<diff[3]<<endl<<degrees[4]<<diff[4]<<endl<<degrees[5]<<diff[5]<<endl;

    outData<<degrees[6]<<diff[6]<<endl<<degrees[7]<<diff[7]<<endl<<degrees[8]<<diff[8]<<endl;

    outData<<degrees[9]<<diff[9]<<endl<<degrees[10]<<diff[10]<<endl<<degrees[11]<<diff[11]<<endl;



    average = 0.0;

    sum = 0;

    for (I=0 ; I < 12; I++)

    sum = sum + degrees[i];



    average = sum / 12 ;



    cout <<” The calculated average temperature is : “ << average <<endl;



    cin.get();

    outData.close();

    return 0;



    }
    progunr's Avatar
    progunr Posts: 1,971, Reputation: 288
    Ultra Member
     
    #2

    Jun 9, 2008, 02:10 PM
    Sorry but, NO.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

What move should I make? Or should I even make one? [ 9 Answers ]

I am a high school student. I play on our girl's varsity basketball team, and I have a bit of an interest/crush on a guy from the guy's team. Our practice and game times are normally in tandem. I see him there and occaisonally in school. Recently, I admitted my interest to a friend, and she said,...

What program should I use? [ 2 Answers ]

Hi, I'm a little bit of a computer illiterate but I want to know what program(s) should I use if I want to make cg (computer graphics)? :p

How to make money through affiliate program? [ 2 Answers ]

Hi all of you, We finally chosen this affiliate program after a long process of other techniques and methods. How its really works helpful will we get money? Thanks, Romaerio.


View more questions Search