1st timer, need help

This is a discussion on 1st timer, need help within the C++ Programming forums, part of the General Programming Boards category; the question i am facing is this. i am writing a program to to prompt for name, sex, code and ...

  1. #1
    coy
    coy is offline
    Registered User
    Join Date
    May 2003
    Posts
    3

    1st timer, need help

    the question i am facing is this. i am writing a program to to prompt for name, sex, code and number. i must look up the rate code which is either 1-4. then i have to print all persons in order and the total of all records. output must show all info entered. this is my first program and have been told to use arrays for this. the only knowledge i have on C is from this web site which is wonderful. if anyone could help me complete this program or tell me if i'm heading in the right direction is greatly appreciated.
    Attached Files Attached Files

  2. #2
    coy
    coy is offline
    Registered User
    Join Date
    May 2003
    Posts
    3

    level

    i was just told to post a level of difficulty for this problem. im not sure since this is out of an online workbook. but i dont consider this to be beyond high school.

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    Most people are not going to download possibly malicious programs from an anonymous source. Read the first and second post in the forum list.

    "the only knowledge i have on C is from this web site"

    Then you're probably already way over your head with this program. I recommend you get the book "Ivor Horton's Beginning C++" if you want to learn C++ with no prior knowledge of programming, although if you do have prior knowledge it's still a great book.

    Otherwise, start with a Hello World program and work up from there. If you don't know about the various types, header files, namespaces, and how to use loops and arrays first, then putting them altogther in one program is going to be difficult.
    Last edited by 7stud; 05-05-2003 at 11:39 PM.

  4. #4
    coy
    coy is offline
    Registered User
    Join Date
    May 2003
    Posts
    3
    sorry, your exactly right, here is the code, my apologies#include <stdio.h>
    #include <ctype.h>
    #include <stdlib.h>
    int main ()
    void fillarray
    void bubblesort
    void sortarray
    void printarray
    int code;
    char x
    struct empdata
    int emp#
    float total;
    printf ("The med code table is as follows:\n
    Male {1=25, 2=30, 3=40, 4=50}\n
    Female {1=20, 2=25, 3=35, 4=45.\n
    1-emp only,\n 2-emp+1 dependent,\n
    3-emp+2 dependents,\n 4-emp+3ormore dependents.\n");
    printf ("Enter your sex and rate code.\n");
    scanf ("%d" "schar", &sex, &code);
    void fillarray
    for male
    code{1}=25 ;
    code{2}=30 ;
    code{3}=40 ;
    code{4}=50 ;
    return o;
    for female
    code{1}=20 ;
    code{2}=25 ;
    code{3}=35 ;
    code{4}=45 ;
    return 0;


    while (code = getchar() {
    switch (code)
    for male = m
    { case '1':
    { printf ("Enter emp# 1-999. Name.");
    break ;

    /*from here i think i continue with the cases*/

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    Read the first and second post in the forum list.

  6. #6
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    P.S. Your code has so many errors. Once again, start with a Hello World program and then build from there.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SIGALRM and timer
    By nkhambal in forum C Programming
    Replies: 1
    Last Post: 06-30-2008, 01:23 AM
  2. tic tac toe crashes :(
    By stien in forum Game Programming
    Replies: 4
    Last Post: 05-13-2007, 07:25 PM
  3. Need help with a count down timer
    By GUIPenguin in forum C# Programming
    Replies: 0
    Last Post: 07-07-2006, 05:18 PM
  4. Timer in Win32
    By nicolas in forum Windows Programming
    Replies: 5
    Last Post: 07-04-2004, 08:21 AM

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