Advertisement
Guest User

Real Code

a guest
Dec 5th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. void check(std::string buildingName, int floorLevel, std::string drinkName, float drinkSize, struct machines)
  2. {
  3. bool correct = true;
  4. if (buildingName == "Snell")
  5. {
  6. if (floorLevel == 1 || floorLevel == 3)
  7. {
  8. if (floorLevel == 1)
  9. {
  10. for (int i = 0; i < 10; i++)
  11. {
  12. if (machines.vendingMachines[0].drinkTypes[i].drinkName == drinkName && machines.vendingMachines[0].drinkTypes[i].drinkSize == drinkSize)
  13. {
  14. correct = true;
  15. }
  16. }
  17. }
  18. else
  19. {
  20. for (int i = 0; i < 10; i++)
  21. {
  22. if (machines.vendingMachines[2].drinkTypes[i].drinkName == drinkName && machines.vendingMachines[2].drinkTypes[i].drinkSize == drinkSize)
  23. {
  24. correct = true;
  25. }
  26. }
  27. }
  28. }
  29. else
  30. {
  31. correct = false;
  32. }
  33. }
  34. else
  35. {
  36. correct = false;
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement