Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

New learners on pascal...a problem needs help...THX!!

coner111coner111 Posts: 5Member
Multiple-Choice Analysis Report
An inter-school mathematics competition, in the form of multiple-choice questions, has been organised. The
answer sheets for participants will be read by using an Optical Mark Recognition (OMR) system, and the options
selected were converted into a text file.
Imagine you are a programmer. You are going to develop a computer program to read all raw text-based data and
produce a detailed analysis report on the competition. The analysis report should include:
 Total number of participants, total number of participating schools and total number of participant(s) from
each participating school
 Winners of individual awards and school awards
 Question analysis, such as the percentage correct for each question
Candidates are required to write a program to generate the analysis report. The coursework should:
 Describe the required plain text data files, including the keys of the multiple-choice questions and their
format
 Define the competition regulations, such as individual awards and school awards
 Display a clear analysis report
Candidates should be aware of the reusability of the program design and justify the use of any data structures and
algorithms in the implementation.



Please give me some sugestions or solutions.THX!!

Comments

  • Phat NatPhat Nat Posts: 757Member
    I would start with creating the layout of the files.
    Something such as this would be very straight-forwrd:

    [STUDENT ANSWERS] Saved as '.mrk'
    [code]
    Student Name
    Student School
    Total number of questions (if allowed, would let you check that all answers are listed)
    Answers Listed one per line, in the format:
    ' '
    [/code]
    [/STUDENT ANSWERS]

    [QUESTIONKEY] Saved as 'Answers.txt'
    [code]
    Keys listed one per line in the format:
    ' '
    [/code]
    [/QUESTIONKEY]

    These are basic file layouts. You can then search the given directory for any .MRK file and load each one, saving important data and read the ANSWERS.TXT file for the correct results.

    After that I would create the Menu system for the program. Remember to use procedures for each section. Something like this (although I am doing this quickly and it may not be complete)
    [code]
    PROGRAM MultiChoice;
    USES Crt, Dos;
    VAR
    DataFilesFound : Boolean;
    [/code]
    [code]
    PROCEDURE DoMenu;
    VAR
    Key : Char;
    Begin
    { Check if files exist (and if desired load into memory) }
    LoadDataFiles;
    Repeat
    ClrScr;
    TextColor(15);
    GotoXY(1,2); WriteLn('MULTIPlE CHOICE ANSWERING SYSTEM');
    GotoXY(1,3); WriteLn('================================');
    { Grey out options if Data Files are not found }
    If Not(DataFilesFound) Then TextColor(7);
    GotoXY(3,5); WriteLn('1. Show award winners');
    GotoXY(4,5); WriteLn('2. Question analysis');
    TextColor(15);
    GotoXY(6,5); WriteLn('3. Set file directories');
    GotoXY(8,5); WriteLn('0. Exit');
    Repeat
    Key := Readkey;
    Until (Key In['1','2','3',0'] AND DataFilesFound) or
    (Key In['3',0']);
    Case Key Of
    '1' : ShowAwards;
    '2' : DoAnalysis;
    '3' : Begin
    SetupFiles;
    LoadDataFiles;
    End;
    End;
    Until Key = '0';
    End;
    [/code]

    This should get you started. After this, I would create a few dummy data files and an answer file. Just put them in the same directory as the program for now.
    Now you have a choice of either creating a method of reading them into memory or you can just access the files each time. The first method is more complicated, but will run much faster with lots of files.

    If you're not going to load the files into memory then work on reading the files for the info you need.

    Start with that & good luck,
    Phat Nat
  • coner111coner111 Posts: 5Member
    would it be better to store students' information by record?
  • Phat NatPhat Nat Posts: 757Member
    : would it be better to store students' information by record?
    :

    That's what I was getting at with storing it in memory. The only issue is that unless you know the maximum number of students that will ever be used (huge limitation) you ill probably want to use linked lists for storing the records instead of just an array of StudentRecord.
    If you haven't worked with linked lists before they can be confusing, but read up on them and we are always glad to help as well.

    Phat Nat
  • coner111coner111 Posts: 5Member
    : : would it be better to store students' information by record?
    : :
    :
    : That's what I was getting at with storing it in memory. The only
    : issue is that unless you know the maximum number of students that
    : will ever be used (huge limitation) you ill probably want to use
    : linked lists for storing the records instead of just an array of
    : StudentRecord.
    : If you haven't worked with linked lists before they can be
    : confusing, but read up on them and we are always glad to help as
    : well.
    :
    : Phat Nat
    the project is almost finshed.
    Plesee feel free to leave some comments or simply debug it.Thz!!
  • coner111coner111 Posts: 5Member
    : : would it be better to store students' information by record?
    : :
    :
    : That's what I was getting at with storing it in memory. The only
    : issue is that unless you know the maximum number of students that
    : will ever be used (huge limitation) you ill probably want to use
    : linked lists for storing the records instead of just an array of
    : StudentRecord.
    : If you haven't worked with linked lists before they can be
    : confusing, but read up on them and we are always glad to help as
    : well.
    :
    : Phat Nat
    the project is almost finshed.
    Plesee feel free to leave some comments or simply debug it.Thz!!
Sign In or Register to comment.