goal.
The goal of this assignment is to solidify your command of C,
including advanced topics such as file I/O, structs and typedefs.
This assignment is worth 10 points. Distribution of points is indicated below.
One component of the educational game you are building will involve data collection. This means things like a username and password for each user of your game, usage data (i.e., which portions of the knowledge domain they've touched) and performance data (i.e., an indication of their grasp of the knowledge they've been exposed to). Taken together, this is called a student profile.
In my flashcard example from hw#1, the knowledge domain is the US states and capitals. So the usage data for each user would be those state/capital pairs which the user has been quizzed on. The user's performance data could be a simple statistic: for each state, the percentage of times s/he has correctly named the capital; and for each capital, the percentage of times s/he has correctly named the state. You'll also need an initial value (maybe -1 in this case) to indicate that the user has not yet been quizzed about a given state/capital or capital/state.
Your job for hw#2 is to write, in C, the code necessary for maintaining three data files:
In the "domain.dat" file, for each element of your knowledge domain you will need to store the following (for example):
In the "users.dat" file, for each user, you need to store the following:
In the individual student profile files (one for each user in "users.dat"), you will need to store the following (for example):
FIRST: print out the timesheet and keep track of how much time you spend doing the tasks outlined below.
1. design.(2 points)
You need to begin with a design document.
Include in the design document a description of the domain knowledge
data you are going to store and how you are going to store it
(1 point) and a description of the user data you are going to
store and how you are going to store it (1 point).
If you make any changes to the game as described in your first
homework, you must document these changes here.
This documentation should be 1-2 pages, 10-point font.
It must be complete -- so you need to be CLEAR and CONCISE.
You MUST print out the documentation and bring it to class on the due date.
2. define your data structures.(2 points)
You must define two data structures:
one to store the domain knowledge (1 point) and
one to store the student profile (1 point).
Hint: use typedef
and struct
.
You must have a way to store profiles for multiple students
(hint: use an array).
Create these definitions in a header file (i.e., a
.h
file, e.g., sklar.h
).
3. build the program.
(6 points total)
You need to write a program in C that does the following:
Name your program with the main() in it:
hw2<your-cs-username>.c
,
so for example, mine is called hw2sklar.c
.
4. submit.
You need to submit your program in two ways: electronically and hard copy.
Follow the submission instructions.
(1) Print out the homework template cover page and fill it out.
(2) Print out the timesheet and fill it out.
(3) STAPLE the cover page, timesheet and hardcopy of your
documentation together.
(4) Make sure your name and CUNIX ID are on all the papers you hand in!
(5) Bring all this to class on the day the assignment is due and
deposit it in the homework box at the front of the classroom within
the first 5 minutes of the class (by 1.15pm).