Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,303 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,469 people online right now. Registration is fast and FREE... Join Now!




stuck in C Program dun have any idea.

 
Reply to this topicStart new topic

stuck in C Program dun have any idea.

raj786911
14 Oct, 2008 - 06:52 PM
Post #1

New D.I.C Head
*

Joined: 14 Oct, 2008
Posts: 2

#include "C1320F08L1testdata.c"
#include<stdio.h>
#include<ctype.h>
#include <string.h>
#include <iostream>

using std::cin;
using std::cout;
using std::endl;

void main();
void Competitions(char str[]);
void AllTeam(char str[]);
void AllTeammembers(char str[]);
void Totaltm(char str[]);
void Totalyr(char str[]);
void AvgGPA(int G[]);
void Avgage(int A[]) ;


void main()
{
int i,j,avg;
int choice;
int rubbish;

char UTAstdt[MAXMEMBERS];
char UTAteam[MAMTEAMS];

cout << "Enter string: \n";
cin.getline(UTAteam, MAXTEAMS);
int len = strlen(UTAteam) - 1;

for (int i = 0; i < len - i; i++) {
swap_values(&UTAteam[i], &UTAteam[len - i]);
}

// Print out the new reversed string
cout << thestring << endl;
return 0;
}

while(choice != 3)
{
printf(" \n");
printf("Enter the option #: ");
printf("\n Option 1. List All Competitions ");
printf("\n Option 2. List All Teams ");
printf("\n Option 3. List All Team Members ");
printf("\n Option 4. Count the Total number of Team members ");
printf("\n Option 5. Count the Totla number of year ");
printf("\n Option 6. Calculate the average GPA ");
printf("\n Option 7. Calculate the average Age ");
printf("\n Option 8. Exit ");
printf("\n");
scanf("%d", &choice);

switch(choice)
{
case 1: Competitions(MAXTEAMS);
break;
case 2: AllTeam(MAXTEAMS);
break;
case 3: AllTeammembers(MAXTEAMS);
break;
case 4: Totaltm(MAXMEMBERS);
break;
case 5: Totalyr(MAXMEMBERS);
break;
case 6: AvgGPA(MAXMEMBERS);
break;
case 7: Avgage(MAXMEMBERS);
break;
case 8: printf("Exited,thanks you to using our system!\n");
printf("press any key and then press the enter to exit\n");
scanf("%d",&rubbish);
break;
default:
printf("Error input!Please input the number between 1-5");
scanf("%d",&rubbish);
}
}
return;
}

void Competitions(int *c, char*)
{
}

void AllTeam(int *T, char*)
{
}

void AllTeammembers(int *m, char*)
{
}

void Totaltm(int *tm, char*)
{
}

void Totalyr(int *yr, char*)
{
}

void AvgGPA(int *G, int*)
{
}

void Avgage(int *A, int*)
{
}

1)list the engineering team competitions that UTA participates in(competitions, sponsor and advisor as minimum)
2)list all the UTA engineering teams by name(team name, competitions, sponsor, number of team members as minimum)
3)list the memebers of a team by name(first name, last name, team name, year/class, GPA, ID number and role as minimum)
4)get team members data for a given team
count the total number of team member
count the number of freshman, sophomores, etc.
calculate the average GPA
calculate the average Age
5)get team members data for all team member
same as # 4 (all four task)
6)sort the members of a single team by
last name
GPA
ID number
7)search for a particular team member by
last name
ID number
8)search for a particular team by
Team name
Competition
Sponsor
9)update the team member data
10)update the team data
11)add new team member data
12)add new team data

**** can't use global variable
**** can't use exit
**** can't use goto
**** can't use break
**** can't use contiue


Attached File(s)
Attached File  test.txt ( 3.65k ) Number of downloads: 3
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Stuck In C Program Dun Have Any Idea.
14 Oct, 2008 - 08:53 PM
Post #2

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,858



Thanked: 49 times
Dream Kudos: 550
My Contributions
Well you didn't give us much to really go on to help you.

Some advice: Break the problem into sub-problems. First work on getting the data into a memory structure that you can manipulate (array/vector/linked list).

Then make a basic user interface.

Then work on the individual functions one by one.

The restrictions should not bother you too much as you should not be using most of those anyway (break come in handy in the switch statement). Global variables,exit, and goto are all considered taboo, and some people don't like break and continue (since they don't leave a well defined structure).
User is offlineProfile CardPM
+Quote Post

raj786911
RE: Stuck In C Program Dun Have Any Idea.
15 Oct, 2008 - 05:57 AM
Post #3

New D.I.C Head
*

Joined: 14 Oct, 2008
Posts: 2

QUOTE(NickDMax @ 14 Oct, 2008 - 09:53 PM) *

Well you didn't give us much to really go on to help you.

Some advice: Break the problem into sub-problems. First work on getting the data into a memory structure that you can manipulate (array/vector/linked list).

Then make a basic user interface.

Then work on the individual functions one by one.

The restrictions should not bother you too much as you should not be using most of those anyway (break come in handy in the switch statement). Global variables,exit, and goto are all considered taboo, and some people don't like break and continue (since they don't leave a well defined structure).






QUOTE(NickDMax @ 14 Oct, 2008 - 09:53 PM) *

Well you didn't give us much to really go on to help you.

Some advice: Break the problem into sub-problems. First work on getting the data into a memory structure that you can manipulate (array/vector/linked list).

Then make a basic user interface.

Then work on the individual functions one by one.

The restrictions should not bother you too much as you should not be using most of those anyway (break come in handy in the switch statement). Global variables,exit, and goto are all considered taboo, and some people don't like break and continue (since they don't leave a well defined structure).




well from the top to the subfunction end i have written so far.. i m not sure dat i have written it correctly or not.. but i also had included my data file from where u can have more idea & the reqirements are on the bottom of the page..

thanks

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/2/08 06:30AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month