can someone help me with these errors please code included

This is a discussion on can someone help me with these errors please code included within the C Programming forums, part of the General Programming Boards category; Errors: unable to open include file 'STDIO.H' highlights # unable to open include file 'CONIO.H' highlights # Function should return ...

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

    can someone help me with these errors please code included

    Errors:
    unable to open include file 'STDIO.H' highlights #
    unable to open include file 'CONIO.H' highlights #
    Function should return a vaule highlights semi colon
    Declaration terminated incorrectly highlights space after brace
    Declaration syntax error highlights space in between in int and grade1
    Undefined symbol 'A'/ Undefined symbol 'B' highlights |
    Undefined symbol 'C'; highlights colon
    Expression syntax* and statement missing ; * highlights space between ; and grade

    Code:
    /*********************
    Program Name:Program 1
    Author:R Grant
    *********************/
    /*********PREPREOCESSOR DIRECTIVES*************/
    /****************HEADER FILES******************/
    #include <stdio.h>/*Standard I/O Header*/ unable to open include file 'STDIO.H'
    #include <conio.h>/*Console  I/O Header*/ unable to open include file 'CONIO.H'
    /************PRE-DEFINED CONSTANTS*******************/
    #define GCSE_Math_Grade_Accepted
    #define GCSE_EnglishLit_Grade_Accepted
    #define GCSE_EnglishLan_Grade_Accepted
    #define GCSE_Science_Grade_Accepted
    #define Job_Status_Accepted
    #define Age_Accepted 
    #define GCSE_Math_Grade_Rejected
    #define GCSE_EnglishLit_Grade_Rejected
    #define GCSE_EnglishLan_Grade_Rejected
    #define GCSE_Science_Grade_Rejected
    #define Job_Status_Rejected
    #define Age_Rejected 
    
    /****USER-DEFINES AND ENUMERATED DATA TYPES****/
    /************FUNCTION PROTOTYPES***************/
    void Input_GCSE_Maths_Data (void);
    void Input_GCSE_EnglishLit_Data (void);
    void Input_GCSE_EnglishLan_Data (void);
    void Input_GCSE_Science_Data (void);
    void Input_JobStatus_Data (void);
    void Input_Age_Data (void);
    void Initialise (void);     
    void Output_statistics (void);
    void Process_Accepted_Data (void);
    void Process_Rejected_Data (void);
    void Process_Input_GCSE_Maths_Data (void);
    void Process_Input_GCSE_EnglishLit_Data (void);
    void Process_Input_GCSE_EnglishLan_Data (void);
    void Process_Input_GCSE_Science_Data (void);
    void Process_Input_JobStatus_Data (void);
    void Process_Input_Age_Data (void);
    void GCSE_Maths_Data (void);
    void GCSE_EnglishLit_Data (void);
    void GCSE_EnglishLan_Data (void);
    void GCSE_Science_Data (void);
    void JobStatus_Data (void);
    void Age_Data (void);
    
    /*************GLOBAL VARIABLES*****************/
    int grade1;
    int grade2;
    int grade3;
    int grade4;
    int num1; 
    int num2; 
    int num3; 
    int num4; 
    int num5; 
    int num6; 
    int num7;
    int year;
    int status;
    
    
    int main (void)			   /***************MAIN FUNCTION******************/
    {
    	Initialise ( );
    	Process_Data ( );
    	Output_Statistics ( );
    }; Function should return a vaule
    void Initialise (void);     
    { Declaration terminated incorrectly 
    	clrscr();
    	GCSE_Maths_Data ();
    	GCSE_EnglishLit_Data ();
    	GCSE_EnglishLan_Data ();
    	GCSE_Science_Data ();
    	JobStatus_Data ();
    	Age_Data ();
    	
    };
    
    void Input_GCSE_Maths_Data (void) /*********user inputting 1st grade section*********/
    
    int grade1; Declaration syntax error 
    { Declaration terminated incorrectly 
    printf ("Please input math grade[A, B or C ]: \n");
    do {
    grade1 = getch();
    grade1 = toupper(letter);
    grade1 = tolower(letter);
    };
    while ((grade1 !=A) && (grade1 !=B) && (grade1 !=C) && (grade1 !=D) && (grade1 !=E) && (grade1 !=F) && (grade1 !=a) && (grade1 !=b) && (grade1 !=c) && (grade1 !=d) && (grade1 !=e) && (grade1 !=f) && (grade1 != ));
    if(grade1 ==A) printf("The grade inputted was A and is acceptable\n");
    if(grade1 ==a) printf("Please input in capitals not lower case");
    else if(grade1 ==B) printf("The grade inputted was B and is acceptable\n"); 
    else if(grade1 ==b) printf("Please input in capitals not lower case");
    else if(grade1 ==C) printf("The grade inputted was C and is acceptable\n");
    else if(grade1 ==c) printf("Please input in capitals not lower case");
    else if(grade1 ==D) printf("The grade inputted was D and is not acceptable\n");
    else if(grade1 ==d) printf("Please input in capitals not lower case");
    else if(grade1 ==E) printf("The grade inputted was D and is not acceptable\n");
    else if(grade1 ==e) printf("Please input in capitals not lower case");
    else if(grade1 ==F) printf("The grade inputted was D and is not acceptable\n");
    else if(grade1 ==f) printf("Please input in capitals not lower case");
    else (grade1 == ) printf("Please input math grade[A, B or C ]: \n");
    };
    
    void Input_GCSE_EnglishLit_Data (void)	/*********user inputting 2nd grade section*********/
    
    int grade2; Declaration syntax error 
    { Declaration terminated incorrectly
    printf ("Please input english lit grade[A, B or C ]: \n");
    do {
    grade2 = getch();
    grade2 = toupper(letter);
    grade2 = tolower(letter);
    };
    while ((grade2 !=A) && (grade2 !=B) && (grade2 !=C) && (grade2 !=D) && (grade2 !=E) && (grade2 !=F) && (grade2 !=a) && (grade2 !=b) && (grade2 !=c) && (grade2 !=d) && (grade2 !=e) && (grade2 !=f) && (grade2 != ));
    if(grade2 ==A) printf("The grade inputted was A and is acceptable\n");
    if(grade2 ==a) printf("Please input in capitals not lower case");
    else if(grade2 ==B) printf("The grade inputted was B and is acceptable\n");
    else if(grade2 ==b) printf("Please input in capitals not lower case");
    else if(grade2 ==C) printf("The grade inputted was C and is acceptable\n");
    else if(grade2 ==c) printf("Please input in capitals not lower case");
    else if(grade2 ==D) printf("The grade inputted was D and is not acceptable\n");
    else if(grade2 ==d) printf("Please input in capitals not lower case");
    else if(grade2 ==E) printf("The grade inputted was D and is not acceptable\n");
    else if(grade2 ==e) printf("Please input in capitals not lower case");
    else if(grade2 ==F) printf("The grade inputted was D and is not acceptable\n");
    else if(grade2 ==f) printf("Please input in capitals not lower case");
    else (grade2 == ) printf("Please input english lit grade[A, B or C ]: \n");
    };
    
    void Input_GCSE_EnglishLan_Data (void)	/*********user inputting 3rd grade section*********/
    
    int grade3; Declaration syntax error 
    { Declaration terminated incorrectly
    printf ("Please input english lan grade[A, B or C ]: \n");
    do {
    grade3 = getch();
    grade3 = toupper(letter);
    grade3 = tolower(letter);
    };
    while ((grade3 !=A) && (grade3 !=B) && (grade3 !=C) && (grade3 !=D) && (grade3 !=E) && (grade3 !=F) && (grade3 !=a) && (grade3 !=b) && (grade3 !=c) && (grade3 !=d) && (grade3 !=e) && (grade3 !=f) && (grade3 != ));
    if(grade3 ==A) printf("The grade inputted was A and is acceptable\n");
    if(grade3 ==a) printf("Please input in capitals not lower case");
    else if(grade3 ==B) printf("The grade inputted was B and is acceptable\n");
    else if(grade3 ==b) printf("Please input in capitals not lower case");
    else if(grade3 ==C) printf("The grade inputted was C and is acceptable\n");
    else if(grade3 ==c) printf("Please input in capitals not lower case");
    else if(grade3 ==D) printf("The grade inputted was D and is not acceptable\n");
    else if(grade3 ==d) printf("Please input in capitals not lower case");
    else if(grade3 ==E) printf("The grade inputted was D and is not acceptable\n");
    else if(grade3 ==e) printf("Please input in capitals not lower case");
    else if(grade3 ==F) printf("The grade inputted was D and is not acceptable\n");
    else if(grade3 ==f) printf("Please input in capitals not lower case");
    else (grade3 == ) printf("Please input english lan grade[A, B or C ]: \n");
    };
    
    void Input_GCSE_Science_Data (void)	/*********user inputting 4th grade section*********/
    
    int grade4; Declaration syntax error 
    { Declaration terminated incorrectly
    printf ("Please input science grade[A, B or C ]: \n");
    do {
    grade4 = getch();
    grade4 = toupper(letter);
    grade4 = tolower(letter);
    };
    while ((grade4 !=A) && (grade4 !=B) && (grade4 !=C) && (grade4 !=D) && (grade4 !=E) && (grade4 !=F) && (grade4 !=a) && (grade4 !=b) && (grade4 !=c) && (grade4 !=d) && (grade4 !=e) && (grade4 !=f) && && (grade4 != ));
    if(grade4 ==A) printf("The grade inputted was A and is acceptable\n");
    if(grade4 ==a) printf("Please input in capitals not lower case");
    else if(grade4 ==B) printf("The grade inputted was B and is acceptable\n");
    else if(grade4 ==b) printf("Please input in capitals not lower case");
    else if(grade4 ==C) printf("The grade inputted was C and is acceptable\n");
    else if(grade4 ==c) printf("Please input in capitals not lower case");
    else if(grade4 ==D) printf("The grade inputted was D and is not acceptable\n");
    else if(grade4 ==d) printf("Please input in capitals not lower case");
    else if(grade4 ==E) printf("The grade inputted was D and is not acceptable\n");
    else if(grade4 ==e) printf("Please input in capitals not lower case");
    else if(grade4 ==F) printf("The grade inputted was D and is not acceptable\n");
    else if(grade4 ==f) printf("Please input in capitals not lower case");
    else (grade4 == ) printf("Please input science grade[A, B or C ]: \n");
    };
    
    void Input_Age_Data (void)		/**********user inputting age section**********/
    
    int num1;  Declaration syntax error 
    int num2; 
    int num3; 
    int num4; 
    int num5; 
    int num6; 
    int num7;
    int year;
    { Declaration terminated incorrectly
    
    printf("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993]: \n");
    printf("Please input current year[2009]:\n");
    while ((num1 !=1988) && (num2 !=1989) && (num3 !=1990) && (num4 !=1991) && (num5 !=1992) && (num6 !=1993) && (num7 !=1994)&&(year !=2009));
    if((num1 ==1988) && (year ==2009)) printf("Person is 21 and fine to do course\n");
    else if((num2 ==1989) && (year ==2009)) printf("Person is 20 and fine to do course\n");
    else if((num3 ==1990) && (year ==2009)) printf("Person is 19 and fine to do course\n");
    else if((num4 ==1991) && (year ==2009)) printf("Person is 18 and fine to do course\n");
    else if((num5 ==1992) && (year ==2009)) printf("Person is 17 and fine to do course\n");
    else if((num6 ==1993) && (year ==2009)) printf("Person is 16 and fine to do course\n");
    else if((num7 ==1994) && (year ==2009)) printf("Person is 15 and cant do course\n");
    else if((num1 ==0) && (year ==2009)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num2 ==0) && (year ==2009)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num3 ==0) && (year ==2009)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num4 ==0) && (year ==2009)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num5 ==0) && (year ==2009)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num6 ==0) && (year ==2009)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num7 ==0) && (year ==2009)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num1 ==1988) && (year ==0)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num2 ==1989) && (year ==0)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num3 ==1990) && (year ==0)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num4 ==1991) && (year ==0)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num5 ==1992) && (year ==0)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num6 ==1993) && (year ==0)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    else if((num7 ==1994) && (year ==0)) printf ("Please input person year of birth[1988, 1989, 1990, 1991, 1992 or 1993] and current year[2009]: \n");
    };
    
    void Input_JobStatus_Data (void)	/*********user inputting job status*********/
    
    int status; Declaration syntax error *
    { Declaration terminated incorrectly
    
    printf ("Please input stats[employed or unemployed]: \n");
    do {;
    status = getch();
    status = employed(status);
    status = unemployed(status);
    };
    while ((status !=employed) && (status !=unemployed) && (status != ));
    if(status ==employed) printf("This person cannot do this course\n");
    else if((status ==unemployed)) printf("This person can do this course\n");
    else (status != )printf ("Please input stats[employed or unemployed]: \n");
    };
    
    void Process_Accepted_Data (void) 		/********PROCESSING ACCEPTED INPUT DAT..........*********/
    {
    	for ((grade1 ==A)||(grade1 ==B)||(grade1 ==C); grade1 <= 
    	Undefined symbol 'A'/ Undefined symbol 'B' Undefined symbol 'C';
    GCSE_Math_Grade_Accepted; grade1 ++);
    Expression syntax and statement missing ;
    	{
    		Process_Input_GCSE_Maths_Data ();
    	};
    	for ((grade2 ==A)||(grade2 ==B)||(grade2 ==C); grade2 <= 
    GCSE_EnglishLit_Grade_Accepted; grade2 ++);
    Expression syntax and statement missing ;
    
    	{
    		Process_Input_GCSE_EnglishLit_Data ();
    	};
    	for ((grade3 ==A)||(grade3 ==B)||(grade3 ==C); grade3 <= 
    GCSE_EnglishLan_Grade_Accepted; grade3 ++);
    Expression syntax and statement missing ;
    
    	{
    		Process_Input_GCSE_EnglishLan_Data ();
    	};
    	for ((grade4 ==A)||(grade4 ==B)||(grade4 ==C); grade4 <= 
    GCSE_Science_Grade_Accepted; grade4 ++);
    Expression syntax and statement missing ;
    
    	{	
    		Process_Input_GCSE_Science_Data ();
    	};
    
    	for ((num1 ==1988) && (year ==2009); num1 <= Age_Accepted; num1 ++);
    	{	
    		Process_Input_Age_Data ();
    	};
    	for ((num2 ==1989) && (year ==2009); num2 <= Age_Accepted; num2 ++);
    	{
    		Process_Input_Age_Data ();
    	};
    	for ((num3 ==1990) && (year ==2009); num3 <= Age_Accepted; num3 ++);
    	{	
    		Process_Input_Age_Data ();
    	};
    	for ((num4 ==1991) && (year ==2009); num4 <= Age_Accepted; num4 ++);
    	{
    		Process_Input_Age_Data ();
    	};
    	for ((num5 ==1992) && (year ==2009); num5 <= Age_Accepted; num5 ++);
    	{
    		Process_Input_Age_Data ();
    	};
    	for ((num6 ==1993) && (year ==2009); num6 <= Age_Accepted; num6 ++);
    	{	
    		Process_Input_Age_Data ();
    	};
    	for ((status ==unemployed) status <= Job_Status_Accepted; status ++);
    	{
    		Process_Input_JobStatus_Data ();
    	};
    };
    void Process_Rejected_Data (void)		/********PROCESSING REJECTED INPUT DAT..........*********/
    {
    	for ((grade1 ==D)||(grade1 ==E)||(grade1 ==F); grade1 <= GCSE_Math_Grade_Rejected; grade1 ++);
    	{
    		Process_Input_GCSE_Maths_Data ();
    	};
    	for ((grade2 ==D)||(grade2 ==E)||(grade2 ==F); grade2 <= GCSE_EnglishLit_Grade_Rejected; grade2 ++);
    	{
    		Process_Input_GCSE_EnglishLit_Data ();
    	};
    	for ((grade3 ==D)||(grade3 ==E)||(grade3 ==F); grade3 <= GCSE_EnglishLan_Grade_Rejected; grade3 ++);
    	{
    		Process_Input_GCSE_EnglishLan_Data ();
    	};
    	for ((grade4 ==D)||(grade4 ==E)||(grade4 ==F); grade4 <= GCSE_Science_Grade_Rejectedd; grade4 ++);
    	{	
    		Process_Input_GCSE_Science_Data ();
    	};
    
    	for ((num1 ==1984) && (year ==2009); num1 <= Age_Rejected; num1 ++);
    	{	
    		Process_Input_Age_Data ();
    	};
    	for ((status ==employed) status <= Job_Status_Rejected; status ++);
    	{
    		Process_Input_JobStatus_Data ();
    	};
    };
    
    {
    system("PAUSE");
    return 0;
    }; 
    /**************OTHER FUNCTIONS*****************/
    Im new to C so I make a lot of beginners mistakes !!!
    Thanks to everyone for helping, Im must be really annoying you *bangs head on desk*

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Okay. Your "int grade1" needs to be after the curly-brace that starts your function, not before it. Your main needs a return to end. You can't put a ; after the name of your function. I don't see anything wrong with your include statements.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    214
    You have way too many ; after lines where there shouldn't be one. Like in the if - else statements and the closing } of a function.
    your main function is suppose to return an int. Yours doesn't

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,506
    First you need to learn how to indent.

    Second, you need to learn how to press the "compile" button a lot more often.
    A development process

    Whilst I (and some others here) could write code for hours and then have it compile first time (if we're lucky), you, most assuredly, cannot.

    Writing several hundred lines of code, pressing compile and being told that it has several hundred errors, then copping out and posting the whole sorry mess on a message board for someone else to fix is NOT a long term strategy.

    Eg.
    Code:
    for ( i = 0 ; i < 10 ; i++ ) {
      printf( "%d\n", i );
    }
    It will compile, it will run. Try it.

    If you did this on the other hand
    Code:
    for ( i = 0 ; i < 10 ; i++ ) ; {
      printf( "%d\n", i );
    }
    which you've done MANY times in your "add a ; to everything" approach, the result will still compile, but you sure do get a different answer when you run it.
    The point is, you discover this after your FIRST for loop, not your HUNDREDTH.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Jan 2009
    Posts
    35
    okay sorry I will take all you advice this is my first program
    Im new to C so I make a lot of beginners mistakes !!!
    Thanks to everyone for helping, Im must be really annoying you *bangs head on desk*

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    conio.h is non-standard, so may not be available in your compiler. stdio.h is standard and certainly SHOULD be standard. The fact that BOTH can not be found indicates that somehow your compiler/IDE settings are not pointing to the right place for the standard include files.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Turbo C uses conio.h, but gives the user the option of using stdio.h - it's not standard, but I wouldn't consider it a problem (aside from the fact that one should avoid using non-standard-ness)

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by sean View Post
    Turbo C uses conio.h, but gives the user the option of using stdio.h - it's not standard, but I wouldn't consider it a problem (aside from the fact that one should avoid using non-standard-ness)
    Not sure if I understand your post correctly, but my reply wasn't meant to say "don't" or "do" use any header file. However, if a particular compiler doesn't have conio.h, then that would explain why it wasn't found. It does, however NOT explain why stdio.h can't be found - the only reasonable explanation for stdio.h not being found is that the IDE settings are not telling the compiler the right place to find header files. If that is fixed, and conio.h is still not found, then that is a different problem.

    conio.h is not unique to Turbo C either - although it is probably where the idea came from - or perhaps MS C version 1.0 had it.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Game Programming
    Replies: 0
    Last Post: 10-14-2002, 01:27 PM
  2. << !! Posting Code? Read this First !! >>
    By kermi3 in forum C# Programming
    Replies: 0
    Last Post: 10-14-2002, 01:26 PM
  3. RAM/Swap Memory Code Errors
    By ghe1 in forum Linux Programming
    Replies: 2
    Last Post: 04-01-2002, 06:37 AM
  4. << !! Posting Code? Read this First !! >>
    By biosx in forum C++ Programming
    Replies: 1
    Last Post: 03-20-2002, 11:51 AM
  5. Merging files (code included)
    By TankCDR in forum C Programming
    Replies: 3
    Last Post: 10-28-2001, 10:06 AM

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