Computer Science 236

CS 236 Labs and Projects


Note: Labs and Projects are to be completed by each student individually (not by groups of students).

Labs are live in-person sessions where TAs help students complete a number of steps in preparation for working on projects.

Projects are assignments where students gain experience with writing code using discrete math concepts.

Assignment Due Date
Lab 0 16 Jan 2024
Lab 1 23 Jan 2024
Project 1 30 Jan 2024
Lab 2 6 Feb 2024
Project 2 13 Feb 2024
Lab 3 5 Mar 2024
Project 3 12 Mar 2024
Lab 4 19 Mar 2024
Project 4
Rule Evaluation Example
26 Mar 2024
Lab 5 2 Apr 2024
Project 5 9 Apr 2024

Help Session Slides

Slides for Project 1 Help Session
Slides for Project 2 Help Session
Slides for Project 3 Help Session
Slides for Project 4 Help Session
Slides for Project 5 Help Session

Project Testing

The project testing page provides test inputs and expected outputs for testing your project.


Compiling Your Code on Linux

When you want to pass off your project, your code needs to compile and run using the g++ compiler on Linux. The version of g++ we use is the one installed on the CS lab machines. We compile your code on Linux with a command similar to this:

$ g++ -Wall -std=c++17 -g *.cpp -o project1

Running Your Code on Linux

Your program will be run with the name of the input file given on the command line. For example, your program could be run like this:

$ ./project1 in10.txt

Your program needs to read its input from the given input file and write its output to the standard output.


Submitting Project Files

Put all your '.cpp' and '.h' files into a '.zip' file. Note that these are the only files you should submit. (Also note that your files need to be either '.cpp' files or '.h' files, no other file extensions are recognized.)

Make sure the files in your '.zip' are NOT within a folder. The pass-off driver is not smart enough to find files in folders.

For example, on linux you could use a command like this:

$ zip project1.zip *.h *.cpp

Submit your '.zip' file on Learning Suite under the correct assignment for the project.


Project Pass-off

Project pass-offs are now available for Project 1.

There are two options for having your project tested and scored.

[Option 1]

Please note that this option does not always work correctly. If this option is not working for you, you need to use [Option 2] to pass off your project.

Go to the pass-off website at this link: https://cs236.cs.byu.edu/
Fill out all the necessary fields. Click the 'Submit' button.

You should have received an email with your submission password for the pass-off website. If you did not receive a password and would like one, please contact a TA on Slack.

Please remember that points may be deducted from your project score each time you run a pass-off.

If the pass-off website is not working, you will need to use [Option 2] and meet with a TA to complete your project pass-off.

[Option 2]

Get on the TA Help Queue.

Once you meet with a TA, they will download your .zip file from Learning Suite and run it through the pass off driver.

It is expected that you will re-enter the queue each time you wish to pass off your project.


Write-Protected Files

The input files given to your program will be write-protected. Your program will need to open input files only for reading, not for both reading and writing. If you attempt to open a write-protected input file for both reading and writing the open will fail.

For the C++ language, this means you need to use 'ifstream' to read input files (and not use 'fstream').


Program Exit Status

Your program must run to completion with a normal exit status for any input. Do not terminate with a non-zero exit status for any input, including inputs that have errors.

For the C++ language, this means that the 'main' function needs to return a value of zero and cannot return any non-zero value.


Other Project Resources


valgrind

Valgrind is a tool that will find memory access problems in your code. You should run valgrind on your code while you are creating it. Valgrind will help you avoid common coding errors and help you save debugging time. Valgrind is available on the Linux machines in the CS labs. You run valgrind on the executable program like this:

$ valgrind --leak-check=full ./project1 in10.txt

When using valgrind you should compile the code with the -g option. This allows valgrind to give better information about the location of memory access problems in the code.