Rookie needs a lead

This is a discussion on Rookie needs a lead within the C Programming forums, part of the General Programming Boards category; Trying to complete a program I've found. I'm fairly new at this, I'm really only looking for leads; not to ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    8

    Rookie needs a lead

    Trying to complete a program I've found. I'm fairly new at this, I'm really only looking for leads; not to have someone write it for me. Maybe an example or two of code to present options for me.

    I will attempt to make a number of smaller programs in order to make sure I understand what is going on here.....mod check, switch statement, etc.

    This is what I have:

    Write an interactive program which makes a preliminary diagnosis of influenza, cold, allergy or unknown. The possible symptoms are: (1) fever, (2) head-ache, (3) sore throat,
    (4) cough, (5) runny nose and (6) sneezing.

    The diagnosis is determined under the following conditions:

    (1) Influenza - A fever and two or more additional symptoms.
    (2) Cold ------ At least three symptoms without a fever.
    (3) Allergy --- At least one symptom without a fever.
    (4) Unknown --- Fever with no other symptoms or any other condition not covered above.

    Input Data: Use the following to test your program.

    A 'y' or 'Y' means yes the patient has the symptom, 'n' or 'N' means no the patient doesn't have the symptom.

    When testing, use exactly the values given including case and in the stated order! The notation something(something) means try(retry) e.g. when prompted for the symptom "sore throat" for the first patient, you should first try u then y.

    Patient *--------------------------Symptoms--------------------------*
    # Fever Headache Sore Throat Cough Runny Nose Sneezing
    835174 Y N u(y) U(y) m(n) M(y)
    841057 y y y n y y
    640524 n n n y y y
    375817 n y y y n n
    639781 y n n n n y
    145830 n n n n y y
    514381 y n n n y n
    904516 n n n n n y
    784215 y y n n y n
    834127 n y n y n y
    452382 (Note: The transposition will cause check digit failure.)
    453282 n n y y y n


    Output Result: The following is an example of what the output should look like:

    Hospital Diagnostic Center

    Enter the patient number (0 to exit): 123456

    Which of the following symptoms does the patient have (Y for yes, N for no);

    Fever -------- y
    Headache ----- n
    Sore Throat -- y
    Cough -------- y
    Sniffles ----- n
    Sneezes ------ n

    The preliminary diagnosis is: Influenza

    Enter the patient number (0 to exit): 0

    Diagnostic Program Terminated


    Requirements:

    (1) Display this heading line only once i.e. when the program is first started up.

    (2) If the patient number fails to pass the "mod 10 check digit"
    technique, display "Invalid patient number." and prompt the
    user to enter a correct number.

    (3) Allow for either an upper or lower case response. If the response is neither Y, y, N nor n, display "Invalid entry." and reprompt the user.
    Use either getc(stdin) or its variant getchar(c) for reading the user response. Finally, your program should have no difficulty dealing with responses such as Yes, NO, YUP, NOPE etc. as-long-as the first character can be construed as a yes or no response.

    (4) Use the switch statement to implement the display of the preliminary diagnosis.

    It is entirely possible the patient might have more the one diagnosis. Be sure to display all possibilities.

    (5) If a patient number of 0 (zero) is entered, terminate the program else continue to prompt for symptoms.




    Thanks once again....you guys helped me last weekend on something I was stuck on. I appreciate all the pointers.

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    How far have you got already?
    What sort of data structures do you think that you will need to store the information in?
    If you want help then post MORE than just your assignment!
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    8
    I have actually just sat down and started playing with ideas of what I will need. My work schedule will probably keep me from really digging into it for a couple of more days.

    Just kind of looking to see what people had for ideas so far.

    I will let you know what I have come up with when I can sit down on it for a bit longer.

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    8
    ok...I have had some time to take a gander at this, but I'm just getting more and more confused.

    I don't think I quite understand how to use the switch statement here.

    I'm also getting puzzled about how to setup the diagnosis area:

    (1) Influenza - A fever and two or more additional symptoms.
    (2) Cold ------ At least three symptoms without a fever.
    (3) Allergy --- At least one symptom without a fever.
    (4) Unknown --- Fever with no other symptoms or any other condition not covered above.

    Can anyone give me some hints on how to start this one.

    Thanks.

  5. #5
    Registered User
    Join Date
    Feb 2002
    Posts
    8
    no hints?

    hmmmmmm.......I think I'm just getting myself more confused the longer I stare at it. I've probably just overlooked something and trying to make it more complicated than it should be.

    Appreciate any help....thanks.

  6. #6
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Please don't bump your own threads, it is against the rules, and is likely to result in your message being deleted.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help a rookie
    By elrookie in forum C Programming
    Replies: 14
    Last Post: 06-14-2007, 11:28 AM
  2. Rookie in need of some compiler startup help
    By Skizdigidy in forum C++ Programming
    Replies: 6
    Last Post: 07-09-2006, 02:15 PM
  3. Student average program rookie in need of help
    By Mshock in forum C Programming
    Replies: 24
    Last Post: 05-17-2006, 01:51 AM
  4. WANTED: Lead Programmer
    By fluid_hres in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 05-10-2006, 08:25 PM
  5. Rookie pointer problem: 2 dimensions, malloc
    By GatesAntichrist in forum C Programming
    Replies: 11
    Last Post: 12-20-2005, 12:35 PM

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