Creating a program that counts each indiviual grade entered and outputs how many of e

This is a discussion on Creating a program that counts each indiviual grade entered and outputs how many of e within the C++ Programming forums, part of the General Programming Boards category; I have to create a program simple using a while loop and sentinel value of z. The program has to ...

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    7

    Question Creating a program that counts each indiviual grade entered and outputs how many of e

    I have to create a program simple using a while loop and sentinel value of z. The program has to let the user enter grades such as A B C D or F,
    and needs a separate counter for each one.must use switch statement.

    eg. please enter a grade or z A
    please enter a grade or z B
    please enter a grade or z B
    please enter a grade or z z

    there was 1 A, 2 B's, 0 C's, 0 D's, 0 F's.


    Please help me with the part after int main()
    i need it to pass in by tomorrow for school.
    Last edited by justinc911; 10-07-2003 at 12:48 PM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,822
    > one.must use switch statement.
    Code:
    switch ( input ) {
       case 'A': num_a++; break;
       // etc etc
    }
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572

    Re: Creating a program that counts each indiviual grade entered and outputs how many of e

    Originally posted by justinc911
    Please help me with the part after int main()
    i need it to pass in by tomorrow for school.

    I suggest you read the top two posts on this board. No one will do your homework here. It is not our fault you waited till the last day to finish your assignment. Show some effort and you will receive help!

    If you want, I could do your homework for you; standard rate $45 an hour with five hour minimum....haha

    axon

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  4. #4
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    Don't be afraid to ask your teacher to clarify things for you, that's what they get paid to do. I assume you've had more than one day to do it, so you could have asked.
    Thor's self help tip:
    Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.

    OS: Windows XP
    Compiler: MSVC

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 10-04-2001, 04:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21