Skip to content

kgwong/SkystonePractice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SkystonePractice

This is a practice assignment for programmers in Project Skystone. It is intended to get programmers used to using C++ and git/GitHub.

Background

Work with the other programmers in the group to destroy the Pillar of Doom!

Requirements

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:

  1. Write a class called {YOURNAME}Programmer that inherits from Programmer. For the remainder of this section {YOURNAME} will refer to your first name. {YOURNAME} for me will be Kevin so {YOURNAME}Programmer will be called KevinProgrammer.
  • 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 call Programmer'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 each ith character in name_, if i is even, add the character's value to x. If i is odd, subtract the character's value from x. The absolute value of x 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 of Programmer should be stated as virtual in your header.
  1. 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 the programmers vector. Use vector.push_back()
  • In the space specified, delete your new'd object.
  • DO NOT CHANGE ANY OTHER CODE OUTSIDE OF WHAT IS SPECIFIED.
  1. 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages