Enumerations

This is a discussion on Enumerations within the C++ Programming forums, part of the General Programming Boards category; Okay I am just learning C++ and I have to make a program that useses enumerations and two switch statements. ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    7

    Enumerations

    Okay I am just learning C++ and I have to make a program that useses enumerations and two switch statements.

    You have the user enter and empoyee title like (accountant, secretary, etc..) But they can only enter the first letter of the title (a, s) and then it will display the full title of the person. And it says to use two switch statements.


    How do I do this?

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    What is your problem? Have you even tried on your own? Do you expect us to write the entire program for you?

    How you do it?

    1) Sit down and think. What have you learned at your lessons? Could there be a connection between the last lession and this assignment?

    2) Do you know how to enumerate/switch? If not, you probably didn't pay attention at your class or didn't do your homework.
    If you did that and still doesn't understand, then you could ask here on how to do it.

    We gladly (?) help people if they have problems with something specific, not writing whole programs. You have to show to us that you have at least tried to do it...
    If you want help, please try to make a more accurate question.

    ...
    I don't even know why I took the time writing this...


    <edit>
    just to speed you on the way:

    http://www.cprogramming.com/tutorial/lesson5.html
    </edit>
    Last edited by Magos; 09-12-2002 at 03:17 PM.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Hmm, I must've been really tired and irritated last night. Here's a little help:
    Code:
    char* GetFullName(char Letter)
    {
      switch(Letter)
      {
        case 'S':
        case 's':
          return "Secretary";
        case 'A':
        case 'a':
          return "Accountant";
        default:
          return NULL;
      }
    }
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    7
    Thank you. Everyone gets irritated once in a while so thnx for your help with that. That was all that I needed.

    Thanx for your time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using enumerations in classes
    By anon in forum C++ Programming
    Replies: 14
    Last Post: 10-10-2006, 03:45 PM
  2. Understanding Enumerations
    By Diablo84 in forum C++ Programming
    Replies: 5
    Last Post: 04-18-2005, 05:05 PM
  3. Using strcmp with enumerations.
    By RealityFusion in forum C++ Programming
    Replies: 15
    Last Post: 08-20-2003, 01:40 AM
  4. Incrementing enum types
    By JarretteBeast in forum C++ Programming
    Replies: 21
    Last Post: 04-17-2003, 09:34 AM
  5. Range of an enumeration...
    By Gamma in forum C++ Programming
    Replies: 3
    Last Post: 04-21-2002, 09:38 PM

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