Advertisement
Spocoman

Easter Trip

Sep 18th, 2023
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     string destination, dates;
  8.     getline(cin, destination);
  9.     cin >> dates;
  10.  
  11.     int night;
  12.     cin >> night;
  13.  
  14.     double sumPerNight = 0;
  15.  
  16.     if (destination == "France") {
  17.  
  18.         if (dates == "21-23") {
  19.             sumPerNight = 30;
  20.         }
  21.         else if (dates == "24-27") {
  22.             sumPerNight = 35;
  23.         }
  24.         else if(dates == "28-31") {
  25.             sumPerNight = 40;
  26.         }
  27.     }
  28.     else if (destination == "Italy") {
  29.  
  30.         if (dates == "21-23") {
  31.             sumPerNight = 28;
  32.         }
  33.         else if (dates == "24-27") {
  34.             sumPerNight = 32;
  35.         }
  36.         else if (dates == "28-31") {
  37.             sumPerNight = 39;
  38.         }
  39.     }
  40.     else if (destination == "Germany") {
  41.  
  42.         if (dates == "21-23") {
  43.             sumPerNight = 32;
  44.         }
  45.         else if (dates == "24-27") {
  46.             sumPerNight = 37;
  47.         }
  48.         else if (dates == "28-31") {
  49.             sumPerNight = 43;
  50.         }
  51.     }
  52.        
  53.     printf("Easter trip to %s : %.2f leva.\n", destination.c_str(), sumPerNight * night);
  54.  
  55.     return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement