Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.10 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "Excercise.h"
  3. #include <cstdlib>
  4. #include "structs.h"
  5.  
  6. Excercise::Excercise(Fraction  f1, Fraction  f2)
  7.     :m_FractionOne{ f1 }, m_FractionTwo{ f2 }, m_SmallerThan{ "Resources/smallerThan.png" }, m_OK{ "Resources/Ok.png" }, m_Nok{"Resources/Nok.png"}
  8.     , m_No{ "Resources/No.png" }, m_Yes{"Resources/Yes.png"}
  9. {
  10.  
  11. }
  12.  
  13. void Excercise::Draw(const Point2f & Bottomleft)
  14. {
  15.     m_FractionOne.Draw(Point2f{ Bottomleft.x, Bottomleft.y }, false);
  16.     m_SmallerThan.Draw(Point2f{ Bottomleft.x + 70, Bottomleft.y});
  17.     m_FractionTwo.Draw(Point2f{ Bottomleft.x + 140, Bottomleft.y }, false);
  18.  
  19.     if (CheckSamllest() == true)
  20.     {
  21.         m_OK.Draw(Point2f{ Bottomleft.x + 280, Bottomleft.y });
  22.     }
  23.     else
  24.     {
  25.         m_Nok.Draw(Point2f{ Bottomleft.x + 280, Bottomleft.y });
  26.     }
  27.  
  28.  
  29. }
  30.  
  31. bool Excercise::CheckSamllest()
  32. {
  33.     if (m_FractionOne < m_FractionTwo)
  34.     {
  35.         return true;
  36.     }
  37.     else
  38.     {
  39.         return false;
  40.     }
  41. }
  42.  
  43. void Excercise::YorN(bool isyes)
  44. {
  45.     if (isyes == true)
  46.     {
  47.         m_Yes.Draw(Point2f{ 100 + 210, 100 });
  48.     }
  49.     else if(isyes == false)
  50.     {
  51.         m_No.Draw(Point2f{ 100 + 210, 100 });
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement