Starting from:
$35

$29

Assignment 3: Make a class!

Overview

(\_/)

(•x•) Howdy

(< )

Now that we know about classes, it’s time for you to make one! Have fun with this, let the creative juices flow. Your class can represent anything, and feel free to make more than one if you want. There are some requirements though. As long as you meet these requirements you’ll get credit for this assignment

Here is the starter code. Please submit the main.cpp, writeup.txt, class.h/.cpp to paperless.

Requirements

1. The Class:

1. Must have a custom constructor

2. Must have a default constructor a. i.e. constructor overloading

3. Must have private members (functions and/or variables)

4. Must have public members (functions)

5. Must have at least one getter function

6. Must have at least one setter function

2. Answer the following questions in writeup.txt:

1. What’s const-correctness and why is it important?

2. Is your class const-correct? How do you know?

3. Initialize an object of your class in the main.cpp file however you’d

like.

Brownie points (cool but not necessary):

• Make a template class!

Note remember to compile you can do the following:

g++ -std=c++11 main.cpp -o main

Plz submit on paperless!

More products