23 Oct 2018: The Company
Instructions
-
Pick an industry.
-
Negotiate amogst your group; break ties with rock-paper-scissor.
-
-
Define a
Company struct
that describes companies within your chosen industry.-
Your struct should contain 4-6 member variables.
-
-
Initialize a new company.
-
Initialize a new reference to your existing company.
-
Use your reference to update two member variables.
-
-
Test your code
-
Stretch Goal Write a function that takes a reference to a
Company struct
, returns nothing, and prints a helpful description of the company.
25 Oct 2018: The Company (cont.)
-
Move your struct definition to a header (
.h
) file.-
The name of your header file should match the name of your struct.
-
Ex.
struct Company {…};
→Company.h
-
-
Write a company description function (see above). Your function should:
-
Take a reference
-
Return nothing
-
Print a description of the company
-
-
Write a program that:
-
Creates a new company
-
Uses the above function to describe this new company
-
30 Oct 2018: Company Class
-
Rewrite your company struct as a class:
-
Make your member variables private
-
Write a custom constructor
-
Rewrite your description function as a member function
-
Add a member function that modifies one or more member variables
-
-
Write a program that:
-
Constructs a new object from user input
-
Uses a member function to modify the object
-
Uses a member function to describe the object
-