CMPT 212 Assignment 4
David Simpson (simpson@cs.sfu.ca)
Mon, 23 Mar 1998 14:21:17 -0800 (PST)
CMPT 212 Assignment 3
Spring 1998 ------------
Due date: 3:30pm, Monday, April 6, 1998
in the assignment drop-off boxes.
LATE ASSIGNMENTS WILL NOT BE ACCEPTED.
1. Goal
- To become familiar with writing Microsoft Windows programs.
2. Overview
- This program extends Assignment 3 by adding a Windows interface.
3. Description
- A sample program is available in the Assignment Lab.
N:\CMPT\212\D1\Asgn4\sample.exe
- Your program should be like the sample program as much as
possible.
- The title on the main window of your program must have your
name on it somewhere. A suggested title is this:
"CMPT 212 Assignment 4 (Your Name)"
- I have created an icon and put it in the file
N:\CMPT\212\D1\Asgn4\Asgn4.ico
You may use it if you want to, or you may create your own icon.
4. Design of the Program
4.1 Modules
- The program will consist of three modules: a "Parse" module,
a "Expression" module, and "Main" module.
4.2 The Parse Module
- Same as Assignment 3.
4.2 The Expression Module
- Same as Assignment 3, except that I have removed "const" from
the two expression pointers in the second "composite"
constructor:
composite(const operation, expr *, expr *)
I made this change so that you can assignment directly from
the parameters to the "op1" and "op2" members of a "composite".
Previously, this could not be done, since you could not
assign from a const to a non-const without casting. Note
that if you are making a clone of the parameters, then this
change will not affect your code.
4.4 The Main Module
- This module contains the main function of the program.
5. Design Features
5.1 Error Checking
- Very little error checking needs to be done.
- The program does not have to check for out-of-memory errors
or input errors.
5.2 Given Code
- The following files are given to you. You must use them.
You must not change them.
parse.h
expr.h
- You must implement all of the functions defined in "parse.h"
and "expr.h".
- These files will be available on the class web page and also
in the Assignment Lab on the N: drive.
5.3 Bool Type
- If you are using a compiler which does not support the "bool"
type, you must define the "bool" type yourself in a header
file called "bool.h". Your program must be able to compile
without errors under the Borland C++ in the Assignment Lab.
5.4 Miscellaneous
- Use "const" wherever possible.
- Use the smallest scope and lifetime for every variable,
constant, and function.
6. Source Code Comments
- Your source code must be fully commented.
- See the Sample Assignment on the web page for an example of
the expected commenting style.
http://www.cs.sfu.ca/CC/212/simpson/98-1/assignments/sample.html
7. Test Runs
- Do "print screens" of these windows:
a. the main window with Expression 1 equal to "1+2" and
Expression 2 equal to "4/(10-3)"
b. the "Enter Expression" dialog box.
c. the "Clear Expression" dialog box.
d. the "Join Expression" dialog box.
e. the "Quit" dialog box.
8. What to Hand In
- Title page containing:
a. Course number
b. Assignment number
c. Student name
d. Student number
e. Student email address
- Listing of the source code in this order:
a. asgn3.cpp
b. parse.h
c. parse.cpp
d. expr.h
e. expr.cpp
f. bool.h (if written -- see Section 5.3 above)
- Scripts of the test runs (see Section 7 above).
(end of assignment)