Thread: Beginning programmer

  1. #1
    Registered User
    Join Date
    Apr 2003

    Beginning programmer

    These are two ways I have decided to approach the problem.

    1) #include <iostream>
    #include <fstream>
    #include <iomanip>
    #include <string>

    using namespace std;

    const int noOfMonths = 12;

    enum month{Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec};

    struct MonthlyRec
    double RainFall;
    double Temp;

    void initialize(ifstream& indata, MonthlyRec list[], int listSize);
    void getData (ifstream& infile, MonthlyRec list {}, int listSize);
    void totalRainforYear(MonthlyRec
    void highTempforYear(ofstream& outData, MonthlyRec list[], int listSize);
    void lowTempforYear(ofstream& outData, MonthlyRec list[], intlistSize);

    2)#include <iomanip>
    #include <cstring>
    using namespace std;
    struct MonthlyInfo
    int Month;
    double Temp;
    double RainFall;

    int main()
    MonthlyRec Month[12]; // Array of 12 structures
    int index; // Loop Counter

    // Get monthly data
    cout << "Enter the month, how much it rained and the average\n";
    cout << "temperature for the month. \n";
    for (index = 0; index < 12; index++);

    I am still working on it, I was just wondering if anybody had any ideas.

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Two things:

    1) Use code tags. See the top of the forum for more info on that.
    2) You need to explain what it is you're trying to do.

  3. #3
    Registered User
    Join Date
    Nov 2002
    it would be best if you kept it in one thread.

  4. #4
    Registered User
    Join Date
    Apr 2003
    ....hmmm....he did say he was working on "the problem".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. beginning C Programmer - Need Help Compiling Program
    By fisguts in forum C Programming
    Replies: 2
    Last Post: 07-30-2008, 02:14 PM
  2. When are you REALLY a programmer?
    By m.mixon in forum C Programming
    Replies: 5
    Last Post: 07-19-2006, 09:08 PM
  3. QT or others for the beginning linux programmer
    By FillYourBrain in forum Linux Programming
    Replies: 3
    Last Post: 09-12-2003, 01:17 PM
  4. beginning programmer needs help with a structures program!
    By psychadelic in forum C Programming
    Replies: 1
    Last Post: 12-03-2002, 10:27 PM
  5. Beginning C programmer...
    By Edgar in forum C Programming
    Replies: 4
    Last Post: 09-24-2001, 12:52 AM