School of Computing & Information Technology
CSCI251 Advanced Programming Assignment 1
Due 11:55pm Friday in Session Week 5
Overview
This assignment is to be implemented using procedural programming. The overall program should fol- low the progress of students through a sequence of subjects that are part of an academic course at an educational institute ABC (A Big College).
Our marking system will run on Capa and Codeblocks. AlthoughHowever, to support students, we agree to support Visual Studio Code for lab only. For assignments, we just use Capa and Codeblocks to mark. Make sure that your code can run on both system.
General code notes
These are some general rules about what you should and shouldn’t do.
1. Your assignment should be organised into:
(a) A driver file containing your main() function.
(b) A header file containing the prototypes for the functions you write.
(c) An implementation file containing the implementations of your functions.
2. Provide a text file Readme.txt with instructions for compiling details, such as codeblocks or Capa or similar.
3. Within your code, be consistent in your tabbing style. We want readable code.
4. Include sensible volumes of commenting.
5. Use appropriate variable names.
6. Don’t leak memory.
7. Your main() function should make it clear what is going on, and shouldn’t be too large.
8. Other than the initial command line input, the program should run without user output. In particular
this means there shouldn’t be pauses waiting for the user to press a key. 1
Run structure
Once your program is compiled into the executable say ABC, it must run as follows: $ /ABC Students.txt Subjects.txt Output-file
When you read from the data files you should report on the data read in. We should see a list of students, a list of subjects; all appropriately formatted so it’s clear you have correctly partitioned the data. Output-file is used to report on results. The students in the students file are to be processed in the order they are given. The run of each student is independent. Each student attempts to go through their plan of study taking each subject in the order listed in their plan. A student cannot take a subject until they completed the previous one on their plan. If a student fails a subject three times in row they are to be excluded from the college. The file Output-file should be ordered by student and contain a clear report on the progression of each student, including subject, and performance for each time they take a subject.
The process involved in a student taking a subject is as follows:
• For the given subject, the student performance (mean and standard deviations) is calculated as follows:
• Mean = Student ability – Subject difficulty
• Standard deviation = Student consistency + Subject variability
Here goes an example using the data listed in the next section. If Average Ant is taking Basic Bouncing,
the Mean and Standard deviation become: • Mean=50-(-10)=60
• Standard deviation = 5 + (-2) = 3
At this point you should report the student name, subject attempted, and the distribution parameters to the Output-file.
* Determine the mark obtained by the student by generating a random value drawn from the subject distribution (that is, the Mean and Standard deviation). Values less than 0 or more than 100 should be appropriately modified so the mark is an integer in the range 0 to 100.
Based on the mark the following different actions are possible: • 0-50: Fail
• 50-64: Pass
• 65-85: Good
• 85+: Very Good
2
Inputs
Two data files will be provided, with the colon and full stops used to seperate fields and rows.
1. Students.txt: No more than 10 entries.
Name,Student code,Ability,Consistency,Program name:Subject list
Example:
Average Ant,204932,50,5,Short course:0,1
Brilliant Bison,234543,80,3,Bachelor of Bounciness:2,5,3
Consistent Canary,123456,60,1,Diploma of Doggeral:3,6
Dusty the Dinosaur,000001,65,3,Master of Extinction:1,2,3,4,5
Iggy the Irratic,369523,50,15,Some Degree of Oddness:7,5,3,1
The name cannot be empty. The Student code is a 6-digit positive number. The Ability is an integer in the range of 20 to 80 inclusive. The Consistency is an integer in the range of 0 to 15 inclusive. The Subject list is associated with from the Subjects.txt. The maximal length of Subject list is 5, while “0” stands for the 1st subject/row from Subjects.txt (Note that C++ index starts from 0).
2. Subjects.txt: No more than 10 entries. Name,Difficulty,Variability
Archery,-15,1
Basic Bouncing,-10,-2
Counting for Animals,0,2
Digging,4,1
Better Bouncing,0,2
Finding Friends,10,3
Gathering Greenery,15,0
Network analysis,15,-2
Computing,8,3
Data Structure,10,3
The name cannot be empty. The Difficulty is an integer in the range of -15 to 15 inclusive. The Variability is an integer in the range of -3 to 3 inclusive.
Output
If there is a problem with one of the input data files, such as it doesn’t open or it contains invalid data, a report should be made to standard error, and the program should abort. The error should be detailed enough to unambiguously identify the problem. The output was explained in the Run structure section.
3
Notes on submission
1. Submission is via Moodle.
2. Any C++ programs submitted which do not produce the desired results are likely to receive a significant deduction. Similarly, if your program doesn’t compile.
3. The Readme.txt file should contain your compilation instruction and the functions mentioned earlier.
4