Page 2 of 2 FirstFirst 12
Results 26 to 35 of 35
  1. #26
    NBA = RIGGED thispego's Avatar
    Location
    Lubbock, TX
    Post Count
    12,596
    NBA Team
    San Antonio Spurs
    Do you go to Southwest Texas State?
    yes i do
    you had/have the class?

  2. #27
    NBA = RIGGED thispego's Avatar
    Location
    Lubbock, TX
    Post Count
    12,596
    NBA Team
    San Antonio Spurs
    Shrda, c++ was the language people are taught in high school, brah.
    yeah, but back then it was c+p = copy + paste

  3. #28
    Maaaaaannnn fuck.... E20's Avatar
    Location
    California
    Post Count
    15,142
    NBA Team
    San Antonio Spurs
    College
    Cal Bears
    PM or ask Baseline_Bum, he's a genius when it comes to programming/mathematics.

  4. #29
    Basketball Expertise spurster's Avatar
    Post Count
    4,132
    NBA Team
    San Antonio Spurs
    no asshole
    my dumbass teacher told us we probably wouldnt need the textbook

    now i'm here wondering if I somehow got stuck into an upper level programming course where everyone seems to be 10 lessons ahead of me
    Well, 90% of programming (at least, of the beginning sort) is copying what you need from a program that is close to what you want to do. Your textbook would/should have examples of reading in and printing out information. Maybe you have online notes that you can look at for this purpose.

    Anyway, to give some help, you should first write a program that can open the input file, read the individual items from one line, print them out again, and close the input file. Then you'll need to put the read and print parts in a loop so they'll get done multiple times. Next, you will need to open and print to the output file. Finally, you'll need an if or a switch statement to count the grades, which you will print out after the loop. I assume because you are supposed to use a count loop that you can assume that there are a certain number of lines in the input file.

  5. #30
    Who is this guy, again? travis2's Avatar
    Post Count
    17,009
    NBA Team
    San Antonio Spurs
    I assume because you are supposed to use a count loop that you can assume that there are a certain number of lines in the input file.
    Or use a "while not eof" condition...

  6. #31
    Mrs.Useruser666 SpursWoman's Avatar
    Name
    Christy
    Post Count
    27,175
    NBA Team
    San Antonio Spurs

    "asshole" is a college professor ... you might want to be a little nicer.

  7. #32
    License to Lillard tlongII's Avatar
    Location
    Portland
    Post Count
    28,727
    NBA Team
    Portland Trail Blazers
    College
    Oregon State Beavers
    That sounds like the same assignment I had 20 years ago!

  8. #33
    Mrs.Useruser666 SpursWoman's Avatar
    Name
    Christy
    Post Count
    27,175
    NBA Team
    San Antonio Spurs
    That sounds like the same assignment I had 20 years ago!

    Me, too ... writing in Pascal.

  9. #34
    俺はまんこが大好きなんだよ baseline bum's Avatar
    Post Count
    97,883
    NBA Team
    San Antonio Spurs
    College
    UCLA Bruins
    Why would you use a count loop for reading in input from a file? The only way it would work is if you knew exactly how many records you had to read in beforehand. Even if you did, it's just as easy to do something like...

    Code:
    while (is >> sid ) {
      is >> avg;
      is >> lgr;
    
      /* do other stuff */
    }
    where is is the input stream you're reading from, sid is a std::string representing the student ID, lgr could be of an enumeration type with values {A,B,C,D,F}, and avg could be a float or an int, depending on how the grader stored it. There's no need to know how many records there are in this case, assuming each record is entered correctly in the prog5input.txt file. It's a much more flexible solution to just keep reading until you hit the end of the file, using the above code block.

  10. #35
    Keith Jackson mookie2001's Avatar
    Location
    The Gables
    Post Count
    13,278
    NBA Team
    San Antonio Spurs
    College
    Texas Longhorns

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •