-
Notifications
You must be signed in to change notification settings - Fork 306
/
Copy pathmain.cpp
114 lines (85 loc) · 3.99 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
Project 5: Part 1 / 4
video Chapter 2 - Part 12
Create a branch named Part1
Purpose: This project continues developing Project3.
you will learn how to take code from existing projects and migrate only what you need to new projects
you will learn how to write code that doesn't leak as well as how to refactor.
NOTE: there are 2 sets of instructions:
One for if you completed project 3
One for if you skipped project 3.
Destructors
===============================================================
If you completed Project 3:
1) Copy 3 of your user-defined types (the ones with constructors and for()/while() loops from Project 3) here
Choose the classes that contained nested classes. Include the nested classes when you copy them over.
2) move all of your implementations of all functions to OUTSIDE of the class.
3) add destructors
make the destructors do something like print out the name of the class.
===============================================================
If you skipped Project 3:
write 3 UDTs below that EACH have:
5 member variables
the member variable names and types should be relevant to the work the UDT will perform.
pick properties that can be represented with 'int float double bool char std::string'
3 member functions with an arbitrary number of parameters
give some of those parameters default values.
constructors that initialize some of these member variables
the remaining member variables should be initialized in-class
for() or while() loops that modify member variables
1) 2 of your 3 UDTs need to have a nested UDT.
this nested UDT should fulfill the same requirements as above:
5 member variables
3 member functions
constructors and loops.
2) Define your implementations of all functions OUTSIDE of the class.
NO IN-CLASS IMPLEMENTATION ALLOWED
3) add destructors to all of your UDTs
make the destructors do something like print out the name of the class.
===============================================================
4) add 2 new UDTs that use only the types you copied above as member variables.
5) add 2 member functions that use your member variables to each of these new UDTs
6) Add constructors and destructors to these 2 new types that do stuff.
maybe print out the name of the class being destructed, or call a member function of one of the members. be creative
7) copy over your main() from the end of Project3
get it to compile with the types you copied over.
remove any code in main() that uses types you didn't copy over.
8) Instantiate your 2 UDT's from step 4) in the main() function at the bottom.
call their member functions.
9) After you finish, click the [run] button. Clear up any errors or warnings as best you can.
you can resolve any [-Wdeprecated] warnings by adding -Wno-deprecated to list of compiler arguments in the .replit file. all of the "-Wno" in that file are compiler arguments.
You can resolve any [-Wpadded] warnings by adding -Wno-padded to the list of compiler arguments in the .replit file. all of the "-Wno" in that file are compiler arguments.
Ignore the Atomic.h and LeakedObjectDetector.h files for now.
You will use those in Part 3 of this project.
*/
/*
copied UDT 1:
*/
/*
copied UDT 2:
*/
/*
copied UDT 3:
*/
/*
new UDT 4:
with 2 member functions
*/
/*
new UDT 5:
with 2 member functions
*/
/*
MAKE SURE YOU ARE NOT ON THE MASTER BRANCH
Commit your changes by clicking on the Source Control panel on the left, entering a message, and click [Commit and push].
If you didn't already:
Make a pull request after you make your first commit
pin the pull request link and this repl.it link to our DM thread in a single message.
send me a DM to review your pull request when the project is ready for review.
Wait for my code review.
*/
#include <iostream>
int main()
{
std::cout << "good to go!" << std::endl;
}