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

Pages: 1-

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 2:58

fix:
2. hold DATA in a file

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);
   }
}

Name: Anonymous 2011-01-05 4:54

>>1
Alright, we'll help.  As long as you tell the President not to mention /prog/ when he gives his press conference tomorrow about the global crisis our code narrowly averted.

Name: Anonymous 2011-01-05 10:57

>>3
it would be easier to use a 3 dimensional array than a struct

Name: Anonymous 2011-01-05 11:12

>>5
What part of HOMEWORK-QUALITY didn't you get?

Name: Anonymous 2011-01-05 17:46

>>6
I don't get homework, as I am in fruitful employment.

Name: Anonymous 2011-01-05 22:21

>>5
3rd would be good, but a 4th dimensional array would be more fitting

Name: Anonymous 2011-01-06 8:47

If this isn't homework, why not just use a spreadsheet? If it were something more serious, you'd just use a database and write some interface for it.

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