lab01 : Objective Cars

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

Pair programming for this lab

This lab may be done solo or in pairs. Before you begin working on the lab, please decide whether you will work solo or with a partner. If you decide to work with a partner, there are a few requirements you must follow:

Step by Step Instructions

Step 1: Getting Ready

Create a repo for this lab in our class organization and clone it to your local machine.

Step 2: Get the starter code

The starter code is in this repo:

Please get the starter code in the same way as lab01. This is a great opportunity to practice working with git and GitHub!

Once you’ve gotten the starter code, typing the ls command on your machine should show you the following files in your current directory:

$ ls
car.cpp  car.hpp  doors.hpp  perf.cpp  perf.hpp

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

Step 2: Understand the Code and Finish car.cpp

In this lab you will create a comprehensive Car class with

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

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

The functionalities of these variables can easily be inferred 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 an enumeration whose declaration is in doors.hpp. It can take one of the four values:

  1. None = 0,
  2. Hinge = 1,
  3. GullWing = 2,
  4. Sliding = 3

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 Group 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 Lab02.