creating counters and code not working

This is a discussion on creating counters and code not working within the C Programming forums, part of the General Programming Boards category; I need to create a counter and display it at the end of my program. I need to use this ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    35

    creating counters and code not working

    I need to create a counter and display it at the end of my program. I need to use this counter to show how many course applications where accepted and rejected based on certain criteria the student has to met to be accepted on to the course, Once the accepted counter has reached 6 or if the user presses say the q key to to quit the program has to stop
    This is what ive done so far and when I run it I cant understand the errors so if people can help me smooth it out so it works and explain it to me that will be great
    Code:
    #include <conio.h> 
    #include <stdio.h> 
    
    void main (void)
    {
         char ch;
         int year1;
         int year2;
         int name
    
         
         
         printf ("Please input applicates full name");
         if (name = %d)printf($d "application record");
         else printf ("Please input applicates name");//if nothing is enterd
         
         
         
         printf ("Please input" %d "maths grade: ");
         ch = getche(a, b, c, d);
         if(get che = a)printf("passed");
         if(get che = b)printf("passed");
         if(get che = c)printf("passed");
         if(get che = d)printf("fail");
         else printf("Please input" %d "maths grade: ");// if nothing is entered
         
         printf ("Please input" %d "english lit grade: ");
         ch = getche(a, b, c, d);
         if(get che = a)printf("passed");
         if(get che = b)printf("passed");
         if(get che = c)printf("passed");
         if(get che = d)printf("fail");
         else printf("Please input" %d "english lit grade: ");// if nothing is entered
      
         printf ("Please input" %d "english lag grade: ");
         ch = getche(a, b, c, d);
         if(get che = a)printf("passed");
         if(get che = b)printf("passed");
         if(get che = c)printf("passed");
         if(get che = d)printf("fail");
         else printf("Please input" %d "english lag grade: ");// if nothing is entered
      
         printf ("Please input" %d "science grade: ");
         ch = getche(a, b, c, d);
         if(get che = a)printf("passed");
         if(get che = b)printf("passed");
         if(get che = c)printf("passed");
         if(get che = d)printf("fail");
         else printf("Please input" %d "science grade: ");// if nothing is entered
         
        
         printf ("Please enter the year of" %d "born: ");//year1
         printf ("Please enter current year: ");//year2
         if (year1 = 1994 - year2 = 2009)printf("15 is not accepted age");
         if (year1 = 1993 - year2 = 2009)printf("16 is an accepted age");
         if (year1 = 1992 - year2 = 2009)printf("17 is an accepted age");
         if (year1 = 1991 - year2 = 2009)printf("18 is an accepted age");
         if (year1 = 1990 - year2 = 2009)printf("19 is an accepted age");
         if (year1 = 1989 - year2 = 2009)printf("20 is an accepted age");
         else (year1 = 0 - year = 0)printf("Please input the year of" %d "born and current year" );//if nothing is entered
             
        
         printf ("Please state if" %d "is employed or unemployed: ");
         ch = getche(e, u);
         if (get che = e)printf (%d "is employed therefore cannot do course");
         if (get che = u)printf (%d "is unemployed therefore can do course");
         else printf ("Please state if" %d "is employed or uneployed: ");//if nothing is entered
        
        
         printf ("Please confirm" %d "information: ");
         printf ("Math grade entered: ");
         printf ("English lit grade entered: ");
         printf ("English lag grade entered: ");
         printf ("Science grade entered: ");
         printf ("Age: ");
         printf ("Job status: ");
         
         printf ("If this information is correct, press y, If this information isnt correct, press n");
         ch = getche(y, n);
         if (getche = y)
         printf ("Based on information entered the math grade is: ");//
         printf ("Based on information entered the english lit grade is: ");//
         printf ("Based on information entered the english lan grade is: ");//
         printf ("Based on information entered the science grade is: ");//
         printf ("Based on information entered age is: ");//
         printf ("Based on information entered job status is: ");//
         if (getche = n) //loop to be entered in here
         else printf ("If this information is correct, press y, If this information isnt correct, press n");//if nothing is entered
        
         system("pause");
         return 0;
         
    }

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    So you want us to debug your program and add a counter for it? Not even interested enough to show the errors?

    Instead, I would like to see your efforts in debugging your program, and adding a counter to it. Debugging is a skill you have to practice to get proficient at.

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,473
    if (name = %d)printf($d "application record");
    Once again, what language are you using in this program? Something other than C I suppose...
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Recreating Clock Code
    By alexisalexus in forum C Programming
    Replies: 2
    Last Post: 03-24-2009, 08:05 PM
  2. Passing counters in functions?
    By xkrja in forum C++ Programming
    Replies: 2
    Last Post: 09-02-2006, 03:03 AM
  3. array of counters
    By luigi40 in forum C# Programming
    Replies: 3
    Last Post: 12-11-2005, 01:25 AM
  4. Can someone help me understand this example program
    By Guti14 in forum C Programming
    Replies: 6
    Last Post: 09-06-2004, 12:19 PM
  5. array of counters
    By dantestwin in forum C++ Programming
    Replies: 5
    Last Post: 07-04-2004, 11:14 AM

Tags for this Thread


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