lab01 : Objective Cars

num ready? description assigned due
lab01 true Objective Cars Thu 04/01 09:00AM Wed 04/21 09:59PM

Goals Step by Step

Step 0: Getting Started

This lab may be done solo, or in pairs. Before you begin working on the lab, please decide if you will work solo or with a partner. As stated in previous labs, there are a few requirements you must follow if you decide to work with a partner. I will re-iterate them here:

Step 1: Copying some programs from my directory

Visit the following web link—you may want to use “right-click” (or “control-click” on Mac) to bring up a window where you can open this in a new window or tab:

Lab01 Files

You should see a listing of several C++ files. Please copy those files into your local lab01 Github repo directory.

If so, you are ready to move on.

If you don’t see those files, go back through the instructions and make sure you didn’t miss a step. If you still have trouble, ask your TA/tutors for assistance.

It’s now time to use the git-command line tools to perform version control for the files in your git repo. The four essential commands we will be using are:

git pull
git add .
git commit -m "Initial version of lab01 files"
git push origin main

Go ahead and type them out on a terminal in your git repo directory. The above commands save a snapshot of your code on Github. To check that this was done successfully open a web browser and navigate to your repo on Github. Then check to see that the starter code appears in your repo.

Note: Every time you add a new piece of logic to your code, you should save a snapshot of the latest version of your code by issuing the commands: git add … , git commit … and git push …. All the previous versions will be available to you as well and you have the option of reverting to older versions (We will see how in later labs). As you go through the rest of this lab you will essentially need to use these commands to keep track of the different versions of your code. Note that you should only keep relevant files in your repo - avoid uploading non-important LARGE files in your repo since this may cause errors when making your submission to Gradescope.

Congratulations on integrating git into your workflow!

Step 2: Understand the Code and Finish car.cpp

In this lab you will create a comprehensive ‘Car’ class with some descriptive variables, constructor, copy constructor, destructor, overloaded assignment operators, and commonly used methods to manipulate member variables.

The definition of the ‘Car’ class will be provided to you in the head file ‘car.hpp’. The member variables are all private, and listed below:

char*  manufacturer;
char*  model;
uint32_t  zeroToSixtyNs;
float  headonDragCoeff;
uint16_t  horsepower;
DoorKind  backseatDoors;
uint8_t  seatCount;

The functionalities of these variables can be easily read from their names. The ‘manufacturer’ and ‘model’ are of the type ‘string’, e.g. manufacturer = ‘Audi\0’ and model = ‘R8\0’, which shall be dynamically managed. ‘zeroToSixtyNs’ is the time taken to accelerate from 0 to 60 mph. There are also ‘headonDragCoeff’, ‘horsepower’, and ‘seatCount’. The ‘backseatDoors’ is of the type enumeration, which can take one of the four values: ‘None = 0’, ‘Hinge = 1’, ‘GullWing = 2’, ‘Sliding = 3’, and its declaration will provide to you in the head file ‘doors.hpp’.

The descriptions of the functionalities of the public methods are listed below:

Step 3: Test Your Code and Upload to Gradescope

The Autograder will use some test cases to check if your implementations are correct. In order to verify them, you’ll need to write your own test code, which can be a ‘main’ function to print out the results, before the submission. Then, write a Makefile to link all dependencies to make and run your test. The lab assignment “Lab01” should appear in your Gradescope dashboard in CS 24. If you haven’t submitted anything for this assignment yet, Gradescope will prompt you to upload your files. For this lab, you will only need to upload your modified file (i.e. car.cpp). If you already submitted something on Gradescope, it will take you to their “Autograder Results” page. There is a “Resubmit” button on the bottom right that will allow you to update the files for your submission. For this lab, if everything is correct, you’ll see a successful submission passing all of the Autograder tests.

Remember to add your partner to Groups Members for this submission on Gradescope if applicable. At this point, if you worked in a pair, it is a good idea for both partners to log into Gradescope and check if you can see the uploaded files for Lab01.