Advertisement
darinab

main.cpp

Mar 25th, 2024
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include "Game.h";
  2. #include "GamePlatform.h";
  3.  
  4. int main() {
  5.     GamePlatform platform;
  6.  
  7.     platform.addGame(Game("Game 1", 19.99, true));
  8.     platform.addGame(Game("Game 2", 0, true));
  9.     platform.addGame(Game("Game 3", 29.99, false));
  10.  
  11.     std::cout << "All games in the platform:" << std::endl;
  12.     platform.printAllGames();
  13.  
  14.     std::cout << "\nCheapest and most expensive games:" << std::endl;
  15.     platform.printCheapestGame();
  16.     platform.printMostExpensiveGame();
  17.  
  18.     std::cout << "\nFree games:" << std::endl;
  19.     platform.printAllFreeGames();
  20.  
  21.     if (platform.removeGame(1)) {
  22.         std::cout << "\nAfter removing a game:" << std::endl;
  23.         platform.printAllGames();
  24.     }
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement