I need help on Student record prog

This is a discussion on I need help on Student record prog within the C Programming forums, part of the General Programming Boards category; Hi all, I have a program that I need help on. I have attatched it to this thread-it is a ...

  1. #1
    Registered User
    Join Date
    Jan 2002

    I need help on Student record prog

    Hi all,
    I have a program that I need help on. I have attatched it to this thread-it is a Student Record program that is meant to read in details of a student from a binary file -store this data(put it in structure in memory) then allowing the user to input 4 test marks working out the average.
    Then it is worked out whether the student has passed/failed-then the details are written to Passed.txt or Failed.txt.
    Thanx, much appreciated.
    Last edited by Hursh; 01-18-2002 at 06:50 AM.

  2. #2
    B26354 Deckard's Avatar
    Join Date
    Jan 2002
    I won't give up all the answers, but here's a biggie:

    typedef struct {
    int GetStudentRecord(void);              /* Reads list from file */
    int EnterandCalcResults(void);           /* Enters marks & calculates results */
    int find(char*,int);                   /* Searches list for entry */
    void WriteToTextFile(int);             /* writes updated list to file */
    You begin defining a structure, but forget to actually "complete the thought" before you move on to your prototypes. Also, STUDENTSlist appears to be an array, but an array of what?

    Good luck.
    Jason Deckard

  3. #3
    Registered User
    Join Date
    Jan 2002
    Thanx for your reply Deckard, well its a question of whether I need an array for the records.
    Right here is the whole program - any input will be HIGHLY praised-please before the end of today-I will be forever in debt to you........

    #include <stdio.h>
    #include <conio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <alloc.h>

    #define FILE_IN"Students.dat"
    #define FILE_OUT"Passed.txt"
    #define FILE_OUT2"Failed.txt"
    #define RECORDS 25

    typedef struct {
    char Fname[32]--------details of chars--------------- ;
    int ID[7]-------;


    int GetStudentRecord(void);
    int Enter&CalcResults(void);
    int find(char*,int);
    void WriteToTextFile(int);

    int GetStudentRecord(void){
    char Fname[32],------------details of chars----------- ;
    int ID[7]-----;

    while(students<RECORDS&&(fscanf(in,"%s%s%d%d%s%s%s ",--------chars----------------)!=feof)){
    and so on...........for all chars.....

    If (in==NULL)
    printf("Can't open file %s\n",FILE_IN);
    return students;

    int Enter&CalcResults(void){
    int a[N];
    float av = 0;
    int j;
    printf("please enter the test marks\n");
    for (j=0;j<N;j++)
    { printf("Test mark %d = ",j+1);
    av = av/N;
    printf("The test marks were in order- ");
    for (j=0;j<N;j++)
    printf("The average mark is %5.3f\n",av);

    char GRADE[1];
    if (av>=0)&&(av<=39) then
    ----------and so on to give overall grade----------

    void WriteToTextFile(int){
    FILE *in,*out;
    PERSON stud;
    char buf[RECORDS+1];
    in = fopen(FILE_IN,"rb");
    if (in==NULL)

    The rest of the code should write details to appropriate text file-either of two


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Database assignment is Killing me!
    By Boltrig in forum C Programming
    Replies: 2
    Last Post: 11-29-2007, 03:56 AM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 05:14 AM
  3. Creating a student grade book-how?
    By Hopelessly confused in forum C Programming
    Replies: 5
    Last Post: 10-03-2002, 09:43 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 02:27 PM
  5. behind and confused
    By steviecrawf in forum C Programming
    Replies: 1
    Last Post: 11-09-2001, 12:51 PM

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