Thread: I have some questions :(

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

    Lightbulb

    I dont know what ya all make of this but Ive spend the morning writing code that I think should hopefully fulfil the requirements of my assignment, I know it doesnt work but I'd like peoples advice and input on what to change and stuff to make it work.

    Code:
    #include <conio.h> 
    #include <stdio.h> 
    
    void main (void)
    {
         char ch;
         int year1;
         int year2;
         int name
         int +1
         
         printf ("Press C to check if accepted and failed applications folder is created: ");
         // Im unsure how and if borland complier can create and/or check folders if someone knows how please share thanks
         
         printf ("If you would like to display how many applications have beed processed, Please press p: ");
         // Im unsure how and if borland complier can display how many applications have beed processed if someone knows how please share thanks 
        
         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
         
         
         printf ("Application is: ");//states whether application is accepted or failed 
         if (Application = accepted)save to C:\Documents and Settings\Administrator\My Documents\Accepted; 
         if (Application = accepted)save as %d; //save under students name
         if (Application = accepted) +1 ;//once the folder has 6 accepted applications:
         printf ("Sorry no more postions left");
         if (Application = failed)save to C:\Documents and Settings\Administrator\My Documents\Failed;
         if (Application = failed)save as %d; // save under students name
         if (Application = failed) +1 ;
         
         printf ("Total applications accepted: "); 
         printf ("Total applications failed: ");
         
         system("pause");
         return 0;
         
    }
    Last edited by geekrockergal; 02-01-2009 at 08:01 AM.

  2. #17
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    What course are you taking and where? What is the text you are using in this course? Are you actually reading it and using it?

  3. #18
    Registered User
    Join Date
    Jan 2009
    Posts
    35
    Quote Originally Posted by rags_to_riches View Post
    What course are you taking and where? What is the text you are using in this course? Are you actually reading it and using it?
    Im taking a foundation science degree in communcation and computer networks @ city of bristol college and yes I am reading and using the course material

  4. #19
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Don't be discouraged by the cantakerous, geekrockergirl!

    Quote Originally Posted by geekrockergal View Post
    // Im unsure how and if borland complier can create and/or check folders if someone knows how please share thanks

    // Im unsure how and if borland complier can display how many applications have beed processed if someone knows how please share thanks
    But don't be too flip either -- your second question verges on thinking outloud to myself only. I presume by "application" you mean some kind of text file and not "application" as in executable program.

    Anyway, w/r/t the first question, how C deals with the filesystem is not specific to one compiler, so your question is really "how can I use C to create and/or check folders?" In fact, this process is the same even across operating systems, but in the documentation they will be called directories and not folders. The first C command you want to look up is opendir. The other is mkdir.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  5. #20
    Registered User
    Join Date
    Jan 2009
    Posts
    35
    Quote Originally Posted by MK27 View Post
    Don't be discouraged by the cantakerous, geekrockergirl!


    But don't be too flip either -- your second question verges on thinking outloud to myself only. I presume by "application" you mean some kind of text file and not "application" as in executable program.

    Anyway, w/r/t the first question, how C deals with the filesystem is not specific to one compiler, so your question is really "how can I use C to create and/or check folders?" In fact, this process is the same even across operating systems, but in the documentation they will be called directories and not folders. The first C command you want to look up is opendir. The other is mkdir.
    I'l try and not be discouraged
    yes I do mean text file, Im not good when it comes to explaining things thanks I'l look up the opendir and mkdir I had a feeling it was something other those lines (from my expeirance of vb) thanks again

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. Several Questions, main one is about protected memory
    By Tron 9000 in forum C Programming
    Replies: 3
    Last Post: 06-02-2005, 07:42 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM

Tags for this Thread