repl.it
@ArlanPereira/

Holiday Programing

C++

No description

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <string>
using namespace std;


int main() {
  cout << "Welcome to your holiday builder" << endl;
  cout << "Select your destination" << endl;

  int userChoice;
  string destinations[] = { "1: Paris £150 per week", "2: Rome £175 per week", "3: Mardid £200 per week", "4: Athens £225 per week"};
  string duration[] = { "1: One week", "2: Weeks", "3: Three weeks", "4: Four weeks"};
  string accomadation[] = { "1: Hotel", "2: Hostel", "3: Flat", "4: Host Family"};
  
  //destinations
  for (int i = 0; i < 4; i++)
  {
    cout << destinations[i] << endl;
  }
  cin >> userChoice;
  if(userChoice == 1){
    cout << "You selected Paris\n";
  }else if(userChoice == 2){
    cout << "You selected Rome\n";
  }else if(userChoice == 3){
    cout << "You selected Mardid\n";
  }else if(userChoice == 4){
    cout << "You selected Athens\n";
  }

  //duration
  cout << "How long do you want to stay??" << endl;
  for (int i = 0; i < 4; i++)
  {
    cout << duration[i] << endl;
  }
  cin >> userChoice;
  cout << "You selected " << duration[userChoice -1] << endl;

  //accomadation
  cout << "Select your accomadation" << endl;
  for (int i = 0; i < 4; i++)
  {
    cout << accomadation[i] << endl;
  }
  cin >> userChoice;
  cout << "You selected " << accomadation[userChoice -1] << endl;


 return 0;
}