Here you can find all the information that you'll need throughout the semester.
All announcements will be made on this page so I recommend you monitor it regularly.
Source for Labs
All the source code we've used or referenced during the semester is in
the labs directory.
Posted: Wed 15 Dec 04 15:23:34 by fredk
Extra credit for final project
If you are able to create objects from their XML representation you
will earn 10 extra points. This is all or nothing, it either works or
it doesn't. I will test in the following way:
Perform one run of your program with a random set of input files
(students, grades and config files) and generate an output XML file.
Then you must supply a command line option so I can perform a second
run using only the XML file as input. If this second run generates
results identicle to the first run then you get 10 extra points,
otherwise you don't.
Of course you must write and read all required data objects which
includes the student records (Roster) and grades (Example, Projects,
Homeworks).
Posted: Mon 13 Dec 04 13:35:24 by fredk
Project4: Final set of guidelines:
XML Requirement: No change from what was discussed in
class, see the notes.
Configuration file format: You must have a configuration
file that conforms to the following format:
Course = cse332
GradeCats = ( Exam = 0.3, Project = 0.5, Homework = 0.2 )
GradeDir = "./Grades"
GradeExt = grd
The configuration parameters have the following meanings:
- Course: This parameter must be used to create an appropriate title
when writing out the results.
- GradeCats: A list of the valid grade categories as
discussed in class. Each category is assigned a weight to be
used when calculating the overall scores. You should be able
to handle an arbitrary list of categories.
- GradeDir: This is the directory where the grade files are
located. You must read this directory and open all regular files
with an extension equal to GradeExt.
- GradeExt: The extension given to all grade files.
One issue you will have is reading all files in a directory. Reading a
directory is similar to reading a file, you will use the function
opendir() to open a directory and readdir() to
read a directory. Since a directory may contain both files and other
directories you also need a way to determine the type an entity, use the
system function stat() for this. Finally, you must close the
directory using closedir().
I've written a simple example which opens a directory, reads its contents,
opens any regular file and extracts tokens. My example is not a
complete solution, in particular I do not verify file extensions. The
code is located at the following url, token.
Posted: Fri 10 Dec 04 12:03:56 by fredk
CString updated example
See CString for an updated solution to the
CString lab.
Posted: Wed 8 Dec 04 17:15:01 by fredk
Final project
The final project is posted, see Project4.html.
We will work on the design and some implementation details next week in
class, so consider attendance mandatory.
You must work in teams of 2 or 3 people on this project. You may pick your own
teams or wait until Tuesday and I will assign.
I am deferring judgment on the XML portion of the project until next week so I
can gauge your progress. You will need to design for it but the
implementation may not be required, we will decide on Thursday 9 Dec - it may
be extra credit.
Posted: Fri 3 Dec 04 19:13:53 by fredk
Lab 6 due date extension
Based on feedback I've decided to extend the lab 6 assignment one week.
It is now due the following Wednesday (8 Dec), you will demonstrate to
me in lab. I view lab 6 as a
background assignment so spend all of your time on the project.
Posted: Sun Nov 21 18:47:04 by fredk
Project 3
I have posted project 3.
Posted: Fri 19 Nov 04 16:08:07 by fredk
Homework 3
I created a design template with directions for you to use when
completing this homework. See the assignment url.
Posted: Fri 19 Nov 04 13:03:51 by fredk
Example CString
By popular demand (thanks Luke) I am making some example code
available that should help you with the CString lab. Use at your own
risk. I wrote this quickly and added some comments when I thought of
it. But it will show you how to define struct's that can hold function
pointers. It will also show by example how to define the functions
and what the CString struct will need to look like. I do have a
StrRep struct similar to the C++ solution. But I have not added code
to deal with reference counting or COW, I leave that for you to do.
As always, ask questions if you don't understand something.
See CString.
Posted: Thu 18 Nov 04 19:13:10 by fredk
Midterm solutions
midterm.doc or midterm.pdf.
Posted: Thu 18 Nov 04 13:47:53 by fredk
Lab 5 and the String class
See the assignment url for details.
For the Midterm you must understand my implementation completely.
Expect several questions asking about the semantics, nested classes
and implementation. Use your lab time to prepare and ask questions.
Posted: Wed 10 Nov 04 10:32:18 by fredk
Lab 5
The String code for the next lab and the midterm is in the directory
String. You will also need the log code in
the directory wulib.
I'll post the String lab on Wednesday.
Posted: Tue 9 Nov 04 19:17:36 by fredk
I posted the notes and example ode
I have posted the example code which overloads the new and delete
operators. I suggest you spend sometime experimenting with the code
so you understand the impact of virtual destructors and memory
allocation. See alloc for the code.
Posted: Sat 6 Nov 04 08:22:46 by fredk
Homework - Not to be turned in
I have posted an extension to lab4, see the Assignments url.
Note, I have updated the lab4 source.
Posted: Fri 5 Nov 04 19:44:28 by fredk
Homework and Lab Assignment
I have posted the assignments I described in class. See the homework
url.
Posted: Fri 8 Oct 04 09:56:37 by fredk
bit fields
There are two ways to handle bit fields. The first uses bitwise
comparisons and the second uses bit-fields in structs. Below I
illustrate the two approaches. I prefer the bitwise comparisons since
I can use bit shifts and bit-comparisons without worrying about alignment
or the byte orientation of the platform. With the structure approach,
if you are interfacing with the low-level hardware you have to worry
about byte and bit alignments (does the struct fill left to right or
right to left). But either approach is fine, use whichever makes the
most sense to you.
enum {Option1 = 0x001,
Option2 = 0x002,
Option3 = 0x004,
Option4 = 0x008,
Option5 = 0x010,
Option6 = 0x020
};
struct Flags_t {
unsigned int opt1 : 1;
unsigned int opt2 : 1;
unsigned int opt3 : 1;
unsigned int opt4 : 1;
unsigned int opt5 : 1;
unsigned int opt6 : 1;
};
int main()
{
unsigned int flags = 0;
Flags_t bflags = {0, 0, 1, 0, 0, 0};
flags = Option1;
flags |= Option3;
if (flags & Option3)
printf ("Option 3\n");
if (bflags.opt3 == 1)
printf ("BFlags: Option 3\n");
exit(0);
}
Posted: Thu 30 Sep 04 19:23:34 by fredk
Homework posted
see the assignments url.
Posted: Thu 30 Sep 04 19:20:55 by fredk
Example reading tokens
I wrote a very simple token extraction helper function as an example
of how to parse the input stream,
see the token directory.
If you are writing an OO program then you may want get_token to act
as a factory creating objects of the correct type (operator, number,
variable etc).
Posted: Thu 23 Sep 04 19:20:12 by fredk
Extended TA hours today
Boris will be in the lab from 10:00am to 2:30PM today (Thursday 23
Sept.).
Posted: Thu 23 Sep 04 12:04:37 by fredk
Project 1
Project 1: a simple calculator, see Project1.html
Due: Wednesday 29 Sept during your lab session.
Posted: Tue 21 Sep 04 19:43:53 by fredk
Lab exercise 2
Mandatory Lab attendance on 15/09 to perform lab exercise 2.
Posted: Sat Sep 11 14:25:10 CDT 2004
Lab exercise 1
Mandatory Lab attendance on 08/09 to perform lab exercise 1.
In general all assignments will be listed on the assignments web page.
Posted: Tue 7 Sep 04 14:11:00 by fredk