This is a practice assignment for programmers in Project Skystone. It is intended to get programmers used to using C++ and git/GitHub.
Work with the other programmers in the group to destroy the Pillar of Doom!
In the main()
function there is a PillarOfDoom
object, initialized with 1000hp. Also in main()
there is a group of programmers
(std::vector<Programmer*>
). To complete this assignment you must:
- Write a class called
{YOURNAME}Programmer
that inherits fromProgrammer
. For the remainder of this section{YOURNAME}
will refer to your first name.{YOURNAME}
for me will beKevin
so{YOURNAME}Programmer
will be calledKevinProgrammer
.
- Write a proper include guard in your header
- Define your constructor to initialize the protected member variable
name_
to a string with{YOURNAME}
. You may need to callProgrammer
's constructor inside of yours. - Define your destructor
- Define the function
damagePillar
with the following specification (no hard-coding please):- Aaron: Accumulate the character values in name_. The values of vowels are worth 3x, else letters are worth 1x. The accumulation/10 (integer divide by 10) is the damage you do.
- Christian: Sum the character values in name_. Take the 8 least significant bits of the sum, flip them, and use the resulting number (from those 8 bits) as the amount of damage you do to the pillar.
- Harvey: Create a local variable
x
. For eachi
th character inname_
, ifi
is even, add the character's value tox
. Ifi
is odd, subtract the character's value fromx
. The absolute value ofx
is the damage you do to the pillar. - Paxton: Sum the character values in name_ and mod(%) the sum by 200. (Get damaged capped l0l). The remaining value is the damage you do to the pillar. Define 200 as a static const member.
virtual
methods ofProgrammer
should be stated asvirtual
in your header.
- Edit main.cpp
- DO NOT PUSH TO GIT IF ANOTHER PROGRAMMER HAS MESSED WITH
MAIN.CPP
, IT CAN CREATE MERGE CONFLICTS. FIND A WAY TO COORDINATE THIS. - In the space specified,
include
your inherited class from part 1 - In the space specified, Add a
new
'd instance of your class to the theprogrammers
vector. Usevector.push_back()
- In the space specified,
delete
yournew
'd object. - DO NOT CHANGE ANY OTHER CODE OUTSIDE OF WHAT IS SPECIFIED.
- Commit your changes to git and push your changed to GitHub without conflicts.
- Your push should add
{YOURNAME}Programmer.h
and{YOURNAME}Programmer.cpp
- Your push should also change
main.cpp
. - Good luck