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}Programmerthat inherits fromProgrammer. For the remainder of this section{YOURNAME}will refer to your first name.{YOURNAME}for me will beKevinso{YOURNAME}Programmerwill 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
damagePillarwith 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 eachith character inname_, ifiis even, add the character's value tox. Ifiis odd, subtract the character's value fromx. The absolute value ofxis 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.
virtualmethods ofProgrammershould be stated asvirtualin 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,
includeyour inherited class from part 1 - In the space specified, Add a
new'd instance of your class to the theprogrammersvector. Usevector.push_back() - In the space specified,
deleteyournew'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.hand{YOURNAME}Programmer.cpp - Your push should also change
main.cpp. - Good luck