Advertisement
Guest User

Functions.cpp

a guest
Apr 13th, 2010
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. #include "Headers.h"
  2.  
  3. using namespace EasterBunny;
  4.  
  5. const double Gift::baseWeight=10;
  6. const double ColoredEgg::eggFactor = 9;
  7. const double ChocolateFigure::chocolateFactor = 10.5;
  8. const double Candy::candyFactor = 13.2;
  9.  
  10. Gift::Gift(int db)
  11. {
  12.         this->db=db;
  13. }
  14.  
  15. ColoredEgg::ColoredEgg(int db, colourtype colour):Gift(db)
  16. {
  17.     this->colour=colour;
  18. }
  19.  
  20. ChocolateFigure::ChocolateFigure(int a, double MeltingPoint):Gift(a)
  21. {
  22.     this->MeltingPoint=MeltingPoint;
  23. }
  24.  
  25. Candy::Candy(int a, qualitytype quality):Gift(a)
  26. {
  27.     this->quality=quality;
  28. }
  29.  
  30. double ColoredEgg::getWeight()
  31. {
  32.         return baseWeight*db*eggFactor;
  33. }
  34.  
  35. double ChocolateFigure::getWeight()
  36. {
  37.         return baseWeight*db*chocolateFactor;
  38. }
  39.  
  40. double Candy::getWeight()
  41. {
  42.         return baseWeight*db*candyFactor;
  43. }
  44.  
  45. colourtype ColoredEgg::getParameter()
  46. {
  47.         return colour;
  48. }
  49.  
  50. double ChocolateFigure::getParameter()
  51. {
  52.         return MeltingPoint;
  53. }
  54.  
  55. qualitytype Candy::getParameter()
  56. {
  57.         return quality;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement