Homework 1
Fall 2020
Due: F 9/4 @ 5 PM
2 points
This homework is to get you familiar with how you'll be submitting projects this semester. You are to
Implement Stack<T>. You can retrieve a zip file containing starter files from cs-class using the command:
cs-class% cp ~maloofm/cosc160/hw1.zip ./This zip file creates a directory named hw1 and includes a Makefile and a file containing the public interface for Stack<T>. You must not change the public interface. To declare an automatically allocated array, you can declare
T contents[100];
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 using GNU g++ 5.3.1. To check the version, type
cs-class% g++ -v Using built-in specs. ... gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC)
All projects must have a file main.h with all of the necessary include directives. 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 "Stack.h" and include "stack.h", it will compile on a Mac, but it won't compile on cs-class or on Autolab.
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 a.out and all of the .o files. You should be able to use Makefile that I've provided with the appropriate modifications.
If you've used your account on cs-class for previous classes, make sure you have the following command in your .bashrc file:
source /opt/rh/devtoolset-4/enableThis ensures you have enabled Red Hat's development tools and the correct version of the C++ compiler.
If you haven't already, set up your shell account. To determine what shell you're using type:
cs-class% echo $SHELLYou 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% cp ~maloofm/mm.bashrc ./.bashrcTo apply the settings in the file, type
cs-class% source .bashrc
From now on, the settings in this file will be applied whenever you log in.
If you are not developing on cs-class, use secure ftp to transfer your files from your computer into this directory.
To descend into the directory, type
cs-class% cd hw1For all of your submissions, you must include a file named HONOR that includes the following statement:
Name NetID In accordance with the class policies and Georgetown's Honor Code, 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.
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 .cc 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% make clean rm -f a.out *.oAlso make sure you remove all debugging output before submitting.
(Additional useful Unix commands)
When you're ready to submit your project for autograding, create a zip file of directory's contents by typing
cs-class% make submitThis command creates a zip file named submit.zip in the current directory that includes all of the files that you have specified in the Makefile. You must edit and update the Makefile as you develop and test your project.
To see the contents of the zip file, type:
cs-class% cd .. cs-class% unzip -l submit.zip Archive: submit.zip Length Date Time Name --------- ---------- ----- ---- 937 2020-07-03 11:21 Makefile 150 2020-07-03 11:49 main.cpp 115 2020-07-03 11:21 main.h 265 2020-07-03 11:21 stack.h 221 2020-07-03 11:21 HONOR --------- ------- 2053 5 filesIt 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 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. For projects, you will have five compile checks and two project submissions. The compile checks help you ensure that your project submission compiles against the autograder, whereas the project submissions run your program against the autograder. To perform a compile check, navigate to the hw1c assignment, and submit your file submit.zip. To submit your project for automatic grading, navigate to the hw1 assignments, and submit your file submit.zip.
Once you've submitted your project, it is important to keep an electronic copy on cs-class, 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% rm submit.zipYou will follow this same process for each assignment.
Copyright © 2020 Mark Maloof. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.