Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

help with c++ (URGENT)

Name: Anonymous 2011-01-05 2:54

I'd REALLY appreciate if you can help me with this, because it's URGENT or I wouldn't ask for help for this kind of stuff and take your time, I'd work on it myself, but I'm sure there are people with more c++ knowledge than I have:

Develop a program "BUS-STATION" that declares a single-dimensional array "LINES" of type structure(fields: firm, destination, price):

1. enter in the array LINES the data: firm, destination, price
2. hold date in a file
3. menu: enter, queries, exit
4. queries: common, firm, destination, minimal price

Name: Anonymous 2011-01-05 3:36

I've done your homeworks with HOMEWORK-QUALITY code.

struct line lines[NUM_LINES];
FILE *lfile = fopen("lines.dat", "r");
if (!lfile) {
   // error, lines.dat can't be opened
}
fread(lines, sizeof(struct line), NUM_LINES, lfile);
fclose(lfile);
int c=0;
while((c = getchar()) != EOF) {
   puts("My Faggot Menu\ne: Enter\nq: Queries\nw: Exit");
   switch (c) {
    case 'e':
      enter();
    case 'q':
      puts("My Faggot Query Menu\nc: Common\nf: Firm\nd: Destination\np: Minimal price");
      // queries here
    case 'w':
      exit(0);
   }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List