Advertisement
murad45

char logic

Nov 28th, 2021
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int money;
  8.     std::cout << "Enter the amount you Spent: " << std::endl;
  9.     std::cin >> money;
  10.     if(money > 300){
  11.         std::cout << "You Spent more than 300$" << std::endl;
  12.         std::cout << "You get 30% discount" << std::endl;
  13.     }
  14.     else if(money > 200 && money < 300){
  15.         std::cout << "You Spent more than 200$" << std::endl;
  16.         std::cout << "You get 20% discount" << std::endl;
  17.     }
  18.     else if(money > 100 && money < 200){
  19.         std::cout << "You Spent more than 100$" << std::endl;
  20.         std::cout << "You get 10% discount" << std::endl;
  21.     }
  22.     else if(money < 100 ){
  23.         std::cout << "You Spent less than 100$" << std::endl;
  24.         std::cout << "You get 5% discount" << std::endl;
  25.     }
  26.  
  27.     return 0;
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement