Thread: challenge...???

  1. #16
    People Love Me
    Join Date
    Jan 2003
    Posts
    412

    Thumbs up

    Quote Originally Posted by civiclx97
    im srry i didnt know how to do the code tags....the purpose is to give a teacher a summary of the students along with their grades in a particular class
    Why, it's easy as pie sir....in fact, I don't believe our boards will let you post a bunch of {}'s and the like without code tags. simply enclose your code within the opening and closing "code tags."

    <code>
    //My readable and indented code goes here.
    </code>

    Simply replace those <>'s with []'s. (If I'd done so, it would've parsed them as code and you wouldn't be able to see the text for the tags themselves.

    Also...
    Code:
    counter>=1
    seems to be a condition you're testing for....you forgot the if there.

    And this really doesn't have much to do with C++ sir...it's C.

    And as said before me, curly braces are your friends. They make code much more readable to you and everyone else. It more clearly illustrates which actions belong to their respective conditions, and where loops begin/end and such.

  2. #17
    n00b
    Join Date
    Feb 2005
    Location
    United Kingd00m
    Posts
    5
    I think it is your teacher who is making you do the work for them to calculate your classes grades :P

    Really if they are setting you this sort of work you should have covered the basic aspects in class - did you get any hints as to how you were expected to complete it?

  3. #18
    Registered User
    Join Date
    Feb 2005
    Posts
    10
    what we've covered so far in class is like averaging grades with if else loops and really basic stuff with while loops but nothing more than doing one simple task...after looking ahead in our text book wouldnt u need to define characters for the name of class, name of student,etc. we did not cover that yet so i am unsure on what variables to define and which can be calculated....she said something about a do while and then two if's.... i cant make sense of that but hopefully somebody can

  4. #19
    n00b
    Join Date
    Feb 2005
    Location
    United Kingd00m
    Posts
    5
    OK, from what you've said, I don't think you are required to set up a data structure. Try setting out in pseudocode what you need to do:
    take the number of students and set up a loop that will loop that amount of times.
    Inside that loop, take more input from the user to get a name, gender and grade. Print out what you were told to print out, increase a "males"/"females" variable and "total male grades"/"female grades" variables.
    Once you are out of the loop, do the simple maths calculations required to find the averages and totals, and print them off.

    Hope this gives some sense of what I think you need to do.

  5. #20
    Registered User
    Join Date
    Feb 2005
    Posts
    10
    ok so that first loop i should use a while loop and then i know you should use an if else statement to calculate the letter grade from the numeric grade, but then how should i keep a total of how many males and females are added...?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. AI Challenge
    By unknown_111 in forum General AI Programming
    Replies: 0
    Last Post: 10-02-2007, 12:18 AM
  2. A Challenge in C++
    By Brad0407 in forum C++ Programming
    Replies: 38
    Last Post: 07-18-2007, 12:56 PM
  3. Programming Challenge (for my school)
    By Ezerhorden in forum C++ Programming
    Replies: 2
    Last Post: 01-04-2006, 06:56 AM
  4. Challenge?
    By Mackology101 in forum C Programming
    Replies: 5
    Last Post: 11-23-2004, 02:30 PM
  5. Requesting a challenge
    By RealityFusion in forum C++ Programming
    Replies: 8
    Last Post: 08-18-2003, 08:24 PM