Thread: Help with Homework... Time is almost up.

  1. #31
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    comparre input to a's and f's ascii values.
    a=97 and f=102

    some entropy with that sink? entropysink.com

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

  2. #32
    Registered User manofsteel972's Avatar
    Join Date
    Mar 2004
    Posts
    317

    Why Case A gives you problems

    The reason why your having problems with Case A: has to do with the fact that you haven't covered all the possible combinations of the 3 integers there are 6 different combinations and you only have 4 of them

  3. #33
    Registered User
    Join Date
    Mar 2004
    Posts
    13

    Talking Newbieville... population.. 1

    How in the heck did I miss that?!? That was it... was missing
    1, 3, 2 and 2, 3, 1 as possible combinations. Thanks!

  4. #34
    Registered User
    Join Date
    Mar 2004
    Posts
    13
    This is what I currently have at the end of the switch...

    Code:
    default : cout << "Not a valid option. You did not choose a character a-f." << endl;
    And this gives the user an error, but only after the user inputs the integers. Is this what you meant?

  5. #35
    Registered User
    Join Date
    Mar 2004
    Posts
    13

    All done.

    I think I am finished for now. I will submit it now just in case an Act of God destroys my computer before I can turn in the assignment ( I had 4 hard drives fail in a row on me until I figured out my power supply was faulty and killing the harddrives).

    Overall, I think it turned out pretty good and I really appreciate all the help everyone has given. I am sure I will be hanging around here from now on as this is better than my own class for getting a grasp on the little details. Have a great evening everybody!

  6. #36
    Registered User manofsteel972's Avatar
    Join Date
    Mar 2004
    Posts
    317

    Just rearrange the statement so it comes after the switch

    You still enter the 3 integers because that code still executes if you place that code after the switch it shouldn't execute you would also need to add a way to terminate the program after the error message maybe an exit call after the default message

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using pointers
    By Big_0_72 in forum C Programming
    Replies: 3
    Last Post: 10-28-2008, 07:51 PM
  2. Journey time prog 1 minute wrong
    By mike_g in forum C Programming
    Replies: 4
    Last Post: 10-12-2006, 03:41 AM
  3. The Timing is incorret
    By Drew in forum C++ Programming
    Replies: 5
    Last Post: 08-28-2003, 04:57 PM
  4. homework time
    By dP munky in forum C Programming
    Replies: 3
    Last Post: 11-23-2002, 04:49 AM