Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Program help C++ and window GUI app.
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wewenaje




PostPosted: Sun Jan 11, 2009 12:06 am   Post subject: Program help C++ and window GUI app.

I am tryng to write a program to do the following things
Quote:

Problem
=========================================================================
You have a list of runners and their race times and ages. Create a
program to display the runners sorted by time with a column showing
their ranking within their age group.

The age groups are
0 - 15 years
16 - 29 years
30+ years

Read the following data from a column delimited (fixed field width) text file....
Name Time Age
--------------------
Steve 12 33
Tim 34 28
Mark 22 37
Tom 21 30
Cliff 13 33
Vini 17 28
Matt 10 28
Ben 9 29
Brandon 15 14


The output should look something like this, displayed in a GUI.

RACE RESULTS
Name Time Age Ranking
===== ==== === =======
Ben 9 29 1
Matt 10 28 2
Steve 12 33 1
Cliff 13 33 2
Brandon 15 14 1
Vini 17 28 3
Tom 21 30 3
Mark 22 37 4
Tim 34 28 4


present the results in a Windows GUI app.


I can write the console program for this but i can't present the results in a Windows GUI app.
can someone please help me with this program??
Sponsor
Sponsor
Sponsor
sponsor
Vertico




PostPosted: Sun Jan 11, 2009 10:57 am   Post subject: Re: Program help C++ and window GUI app.

http://www.winprog.org/tutorial/
wewenaje




PostPosted: Sun Jan 11, 2009 11:38 am   Post subject: Re: Program help C++ and window GUI app.

i looked at this site before i was not able to do what i want to do
can someone help me change the following c++ code into window gui app. code
I use visual c++ 2008 express adition
code:

#include <iostream>
#include <string>
#include <conio.h>
#include <iomanip>
#include <fstream>
using namespace std;
//=============STRUCTURE DECLARATION===============
        struct list_of_runners
       
        {
                string name;
                int Time ;
                int age;
                int Ranking;
       
        };
//======================== MAIN START HERE===========
int main()
{       
    //=========== VARIABLES DECLARATION===================
        int  number_of_Runners;
        list_of_runners* Runners_list= NULL;
        ifstream runners_data_in;
        ofstream runners_data_out;

    //============================INPUT==============================
        runners_data_in.open("c:\\runners_in.txt");
        runners_data_out.open("c:\\runners_out.txt");

        runners_data_in>> number_of_Runners;

        Runners_list = new list_of_runners[number_of_Runners]; 
        for (int i=0; i<number_of_Runners; i++)
        {
                runners_data_in>>Runners_list[i].name >>Runners_list[i].Time>>Runners_list[i].age ; 
        }
        //======================OUTPUT=============================
        runners_data_out<<"\t\t RACE RESULTS \n\n\nRunners \t time \t age \t Ranking\n";
       
        runners_data_out<<"======= \t ==== \t ===\t =======\n\n";
        for (int t=0; t<number_of_Runners; t++)
        {              
                runners_data_out <<Runners_list[t].name<<"\t\t"<< Runners_list[t].Time <<"\t"<<Runners_list[t].age<<"\t"<<Runners_list[t].Ranking<<"\n";
        }
        cout<<"\n\n Total \t\t\t"<<"\n\n";
        //=====================HOUSE CLEANING==============
        delete[] Runners_list;
        //===================== WAIT THEN CLOSE============
        cout<<"\n\npress any key to continue"; 
        getch();
        return 0;
}

if it is too much to ask, help me with what you can.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: