COSC-052: Computer Science II

Homework 1
Spring 2023

Due: W 1/25 @ 5 PM
2 points

This homework is to get you familiar with program organization, Makefiles, and with how you'll be submitting projects this semester. You are to

  1. Get the code from lecture, Numbers and main, running on your chosen development platform. You might find the screencast on program organization helpful.
  2. Compile and test the project on “cs-class” (class-1.cs.georgetown.edu, aka cs-class-1.uis.georgetown.edu) ensuring it works with the Makefile from lecture. You might find the screencast on Makefiles helpful. There is also a screencast on how to use Xcode to complete this assignment.
  3. Submit the project using Autolab. You can submit to the compile check five times. You can submit to the autograder two times.

Excruciating Detail

Get the code from lecture, Numbers and main, running on your chosen development platform.

For this and all other assignments, you can use any C++ compiler to develop your program, but your project must compile and run on cs-class-1 using GNU g++ 8.5.0 and -std=c++11. Note that when you connect to cs-class, you must be on SaxaNet, and not GuestNet. GuestNet blocks the port that ssh uses to connect to cs-class. Once you're connected to cs-class, to check the compiler version, type the command, which is set in bold text:

cs-class-1% g++ --version
g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-17)
...

Keep in mind that file names on Linux machines are case sensitive, and on Macs they probably are not, even though it's a Unix machine. For example, on a Mac, if you have a file named "Numbers.h" and use #include "numbers.h", it will compile on a Mac, but it will not compile on cs-class or on Autolab.

For this and all other assignments, you must provide the file main.h that includes the .h files of your project. This is so I do not have to enforce a naming convention for source files. Furthermore, each .h file should use the standard namespace with the command using namespace std;. Do not use prefixes such as using namespace std::cout because it will not compile against the autograder. If it is good enough for Stroustrup, it is good enough for us.

For this and all other assignments, you must provide a working Makefile for your project. The Makefile must produce an executable with the default name a.out. There must be a clean target that removes all of the .o files.

If you haven't already, set up your shell account. To determine what shell you're using type:

cs-class-1% echo $SHELL
You should see "/bin/bash".

To configure bash, the Bourne Again Shell, from your top-level directory, copy the following file from the top-level directory maloofm:

cs-class-1% cp ~maloofm/mm.bashrc ./.bashrc
To apply the settings in the file, type
cs-class-1% source .bashrc

From now on, the settings in this file will be applied whenever you log in.

If you haven't already, place all of your code in a subdirectory named hw1. To create this subdirectory in your top-level directory, type

cs-class-1% cd
cs-class-1% mkdir hw1
If you are developing on cs-class-1, you'll create this directory before starting your project. If you are not developing on cs-class-1, use secure ftp to transfer your files from your computer into this directory.

To descend into the directory, type

cs-class-1% cd hw1
For all of your submissions, you must include a file named HONOR that includes the following honor statement:
In accordance with the class policies and Georgetown's Honor System,
I certify that, with the exceptions of the course materials and those
items noted below, I have neither given nor received any assistance
on this project.

Name
NetID

All of the files for your project should be in the directory hw1. For this assignment, the files you need are:

If you need to include a message about your submission, then place the message in a plain-text file named README. Place the README file in the project's directory. You can also use .cpp as the file extension.

Before submitting, to reduce the size of the zip file, remove the executable and .o files by typing 'make clean':

cs-class-1% make clean
rm -f a.out *.o
Also make sure you remove all debugging output before submitting.

(Additional useful Linux and Unix commands)

When you're ready to submit your project for autograding, create a zip file of directory's contents by typing

cs-class-1% zip ../submit.zip *
This command creates a zip file named submit.zip in the parent directory (../) that includes all of the files (*) in the current directory.

To see the contents of the zip file, type:

cs-class-1% cd ..
cs-class-1% unzip -l submit.zip
Archive:  submit.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      937  2018-01-03 11:21   Makefile
      150  2018-01-03 11:49   main.cpp
      115  2018-01-03 11:21   main.h
      265  2018-01-03 11:21   numbers.h
      365  2018-01-03 11:21   numbers.cpp
      221  2018-01-03 11:21   HONOR
---------                     -------
     2053                     6 files
It is imperative that the zip file contains only the files of your project with no subdirectories.

Use a secure file-transfer program (sftp or FileZilla) to transfer the zip file from cs-class-1 to your laptop. (You can also produce the zip file on your laptop.)

To submit the zip file, use your browser to log on to Georgetown's instance of Autolab. The first time you connect, enter your Georgetown email address and indicate that you forgot your password. You should receive an email that will let you enter a strong, unique password.

Once you authenticate, you can conduct a compile check to make sure your submission compiles against the autograder. You have five chances. For example, navigate to the hw1c compile check, and submit your file submit.zip. You'll receive a score of 1.0 if the project successfully compiles and a score of 0.0 if it does not. If the submission does not compile, you can diagnose the problem by looking at Autolab's output.

You can submit twice to the autograder, which assigns a provisional grade. Navigate to the hw1 project, and submit your file submit.zip. You'll receive a score out of 100 points. You can diagnose any problems by looking at Autolab's output.

As for strategy, you should plan on submitting to the compile checks and the autograder at least two or three days before the deadline. This will give you some time to try to understand any issues and seek help from either me or the course assistants.

Once you've submitted your project, it is important to keep an electronic copy on cs-class-1, which preserves the modification date and time of your project. If the submission system breaks or you submit the wrong project, then we will need to look at the modification date and time of your project to ensure that you submitted it before it was due.

Once you receive a grade for a project, you can remove the zip file, the project directory, or both. To remove the zip file, type:

cs-class-1% rm submit.zip
To remove the directory, type:
cs-class-1% rm -r hw1
You will follow this same process for each assignment.

Plan B

If Autolab is down, upload your zip file to Canvas.

Copyright © 2023 Mark Maloof. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.