writing flighting system

so i need to write a flighting system , ask name then what number between 1 - 5 and each number has a specific time, how would I write the loop for it to display lets say I write (2) then it must give number (2)'s time above etc?

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
 #include <iostream>

using namespace std;
int main()
{
string name;
int number;
string seat;

    cout << "Welcome to COS1511 Flight Booking System"<< endl;
    cout << "Enter full name : " ;
    cin >> name ;


    cout << "The available travel times for flights are : " << endl;
    cout << "       Depart          Arrive" << endl;
    cout << "1.     7.00            9.30"  << endl;
    cout << "2.     9.00            11.30" << endl;
    cout << "3.     11.00           13.30" << endl;
    cout << "4.     13.00           15.30" << endl;
    cout << "5.     15.00           17.30" << endl;

cout << "Choose the time by entering the option number from the displayed list : " << endl;
        cin >> number ;

if (number > 6)     {
                    cout << "Incorrect Option! Please choose 1 - 5." << endl;
                    };



if (number = 1) {
                    cout << "The available seats for 7.00 are as follows : " << endl;
                    cout << "First Class (1920.00)" << endl;
                    cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
                    cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
                    cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
                    cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
                    cout << "|Economy class (1600.00)" << endl;
                    cout <<"|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
                    cout <<"|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
                    cout <<"|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
                    cout <<"|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
                    cout <<"|I1|I2|" << endl;
                    cout <<"        Please Enter A Seat : " << endl;
                    cin >> seat ;
                }
if (number = 2) {
                    cout << "The available seats for 9.00 are as follows : " << endl;
                    cout << "First Class (1920.00)" << endl;
                    cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
                    cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
                    cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
                    cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
                    cout << "|Economy class (1600.00)" << endl;
                    cout <<"|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
                    cout <<"|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
                    cout <<"|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
                    cout <<"|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
                    cout <<"|I1|I2|" << endl;
                    cout <<"        Please Enter A Seat : " << endl;
                    cin >> seat ;
}
if (number = 3) {
                    cout << "The available seats for 11.00 are as follows : " << endl;
                    cout << "First Class (1920.00)" << endl;
                    cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
                    cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
                    cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
                    cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
                    cout << "|Economy class (1600.00)" << endl;
                    cout <<"|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
                    cout <<"|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
                    cout <<"|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
                    cout <<"|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
                    cout <<"|I1|I2|" << endl;
                    cout <<"        Please Enter A Seat : " << endl;
                    cin >> seat ;
}
if (number = 4) {
                    cout << "The available seats for 13.00 are as follows : " << endl;
                    cout << "First Class (1920.00)" << endl;
                    cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
                    cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
                    cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
                    cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
                    cout << "|Economy class (1600.00)" << endl;
                    cout <<"|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
                    cout <<"|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
                    cout <<"|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
                    cout <<"|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
                    cout <<"|I1|I2|" << endl;
                    cout <<"        Please Enter A Seat : " << endl;
                    cin >> seat ;
}
if (number = 5) {
                    cout << "The available seats for 15.00 are as follows : " << endl;
                    cout << "First Class (1920.00)" << endl;
                    cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
                    cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
                    cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
                    cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
                    cout << "|Economy class (1600.00)" << endl;
                    cout <<"|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
                    cout <<"|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
                    cout <<"|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
                    cout <<"|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
                    cout <<"|I1|I2|" << endl;
                    cout <<"        Please Enter A Seat : " << endl;
                    cin >> seat ;
}


return 0;
}
Hello Anonomys,

First look at your program:

The indenting is terrible as in not easy to read.

As you will see you do not need a "cout" and "endl" for every line, Lines in double quotes become 1 big string and the insertion operator (<<) can chain more than 1 item into 1 "cout".

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include <iostream>

using namespace std;  // <--- Best not to use.

int main()
{
    string name;  // <--- May not cause an error, but still needs the header file "<string>".
    int number;
    string seat;

    cout << 
        "Welcome to COS1511 Flight Booking System\n"
        "Enter full name : ";
    cin >> name;  // <--- Requires header file "<string>" for "cin" and "cout" to know how to process the string.

    cout << 
        "The available travel times for flights are :\n"
        "       Depart          Arrive\n"
        "1.     07.00           09.30\n"  // <--- Changed.
        "2.     09.00           11.30\n"  // <--- Changed.
        "3.     11.00           13.30\n"
        "4.     13.00           15.30\n"
        "5.     15.00           17.30\n";

    cout << "Choose the time by entering the option number from the displayed list : " << endl;
    cin >> number;

    if (number > 6)
    {
        cout << "Incorrect Option! Please choose 1 - 5." << endl;
    };



    if (number = 1)
    {
        cout << "The available seats for 7.00 are as follows : " << endl;
        cout << "First Class (1920.00)" << endl;
        cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
        cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
        cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
        cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
        cout << "|Economy class (1600.00)" << endl;
        cout << "|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
        cout << "|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
        cout << "|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
        cout << "|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
        cout << "|I1|I2|" << endl;
        cout << "        Please Enter A Seat : " << endl;
        cin >> seat;
    }

    if (number = 2)
    {
        cout << "The available seats for 9.00 are as follows : " << endl;
        cout << "First Class (1920.00)" << endl;
        cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
        cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
        cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
        cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
        cout << "|Economy class (1600.00)" << endl;
        cout << "|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
        cout << "|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
        cout << "|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
        cout << "|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
        cout << "|I1|I2|" << endl;
        cout << "        Please Enter A Seat : " << endl;
        cin >> seat;
    }

    if (number = 3)
    {
        cout << "The available seats for 11.00 are as follows : " << endl;
        cout << "First Class (1920.00)" << endl;
        cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
        cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
        cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
        cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
        cout << "|Economy class (1600.00)" << endl;
        cout << "|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
        cout << "|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
        cout << "|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
        cout << "|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
        cout << "|I1|I2|" << endl;
        cout << "        Please Enter A Seat : " << endl;
        cin >> seat;
    }

    if (number = 4)
    {
        cout << "The available seats for 13.00 are as follows : " << endl;
        cout << "First Class (1920.00)" << endl;
        cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
        cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
        cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
        cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
        cout << "|Economy class (1600.00)" << endl;
        cout << "|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
        cout << "|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
        cout << "|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
        cout << "|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
        cout << "|I1|I2|" << endl;
        cout << "        Please Enter A Seat : " << endl;
        cin >> seat;
    }

    if (number = 5)
    {
        cout << "The available seats for 15.00 are as follows : " << endl;
        cout << "First Class (1920.00)" << endl;
        cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
        cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
        cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
        cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
        cout << "|Economy class (1600.00)" << endl;
        cout << "|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
        cout << "|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
        cout << "|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
        cout << "|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
        cout << "|I1|I2|" << endl;
        cout << "        Please Enter A Seat : " << endl;
        cin >> seat;
    }


    return 0;
}

On line 13 you are asking for a full name, but line 14 as formatted input will only read until a white space or new line is encountered, whichever comes first. Given a name of "Etienne Navarre" only "Etienne" will be stored in the variable "name" leaving the next "cin" to read what is left.

If you are wanting a full name that contains space(s) you need to use "std::getline()". In addition to "<string>" being needed for the "cin" and "cout" statements, "std::getline()" is defined in the string class.

This code is duplicate in every if statement. The only part I see that changes is the time.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
cout << "The available seats for 15.00 are as follows : " << endl;
cout << "First Class (1920.00)" << endl;
cout << "|A1|A2|A3| - - - - |A4|A5|A6|" << endl;
cout << "|B1|B2|B3| - - - - |B4|B5|B6|" << endl;
cout << "|C1|C2|C3| - - - - |C4|C5|C6|" << endl;
cout << "|D1|D2|D3| - - - - |D4|D5|D6|" << endl;
cout << "|Economy class (1600.00)" << endl;
cout << "|E1|E2|E3| - - - - |E4|E5|E6|" << endl;
cout << "|F1|F2|F3| - - - - |F4|F5|F6|" << endl;
cout << "|G1|G2|G3| - - - - |G4|G5|G6|" << endl;
cout << "|H1|H2|H3| - - - - |H4|H5|H6|" << endl;
cout << "|I1|I2|" << endl;
cout << "        Please Enter A Seat : " << endl;
cin >> seat;

You could set up the times in an array of strings and using the number input from the menu selection you can write the first line using a variable and you would only need the above code once. As an alternative a "switch" would also work, if you have studied "switch".

I have some ideas, but it will take me a bit to rework what you started with.

Also thinking a do/while or while loop is needed, but first get the program working.

Andy
Hello Anonomys,

I noticed in your if statements you have if (number = 1). (=) means to assign and (==) means to compare.

A rearrangement of your code to remove duplication:
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <iostream>
#include <limits>
#include <string>

#include <utility>

using namespace std;  // <--- Best not to use.

int main()
{
    constexpr int MINCHOICE{ 1 }, MAXCHOICE{ 6 };
    const std::string PROMPT{ " Enter choice: " };  // <--- Change to what you like.
    const std::string times[]
    {
        "",  // <---Place holder, so that "menuChoice" will match up with the correct element.
        "07.00",
        "09.00",
        "11.00",
        "13.00",
        "15.00"
    };
    string name;       // <--- May not cause an error, but still needs the header file "<string>".
    int menuChoice{};  // <--- ALWAYS initialize all your variables.
    string seat;

    cout << 
        "Welcome to COS1511 Flight Booking System\n\n"
        "Enter full name : ";
    std::getline(std::cin, name);  // <--- Changed.

    cout <<
        "\n"
        "The available travel times for flights are:\n"
        "       Depart          Arrive\n"
        "1.     07.00           09.30\n"  // <--- Changed.
        "2.     09.00           11.30\n"  // <--- Changed.
        "3.     11.00           13.30\n"
        "4.     13.00           15.30\n"
        "5.     15.00           17.30\n"
        "6.     Exit\n";                  // <--- Added for futute use.

    while (std::cout << PROMPT && !(std::cin >> menuChoice) || menuChoice < MINCHOICE || menuChoice > MAXCHOICE)
    {
        if (!std::cin)
        {
            std::cout << "\n     Invalid entry! Must be a number.\n\n";

            std::cin.clear();
            std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');  // <--- Requires header file <limits>.
        }
        else if (menuChoice < MINCHOICE || menuChoice > MAXCHOICE)
        {
            std::cout << "\n     Invalid choice! Try again.\n\n";
        }
    }

    if (menuChoice == 1)
    {
        cout << 
            "\n"
            "The available seats for " << times[menuChoice] << " are as follows:\n\n";
    }

    if (menuChoice < 6)
    {
        cout <<
            "First Class (1920.00)\n"
            "|A1|A2|A3| - - - - |A4|A5|A6|\n"
            "|B1|B2|B3| - - - - |B4|B5|B6|\n"
            "|C1|C2|C3| - - - - |C4|C5|C6|\n"
            "|D1|D2|D3| - - - - |D4|D5|D6|\n\n"
            "|Economy class (1600.00)\n"
            "|E1|E2|E3| - - - - |E4|E5|E6|\n"
            "|F1|F2|F3| - - - - |F4|F5|F6|\n"
            "|G1|G2|G3| - - - - |G4|G5|G6|\n"
            "|H1|H2|H3| - - - - |H4|H5|H6|\n"
            "|I1|I2|\n"
            "   Please Enter A Seat : ";
        cin >> seat;

    }

    return 0;
}

Lines 57 - 63 can be copied and pasted for choices 2 - 5.

Line 64 is more for temporary use right now. When you add a do/while or while loop for most of main you will need an if statement for choice 6. A "continue" will bypass any code left and go to the while condition. Or a "break" statement will leave the loop.

I did have 1 question. Once you pick a seat how are you intending to deal with marking that seat taken?

Based on my code you could put lines 31 - 81 in a do/while or while loop. Personally I would use a do/while loop, but either will work.

Having the seats hard coded means they can not change at run time. This needs reworked. Maybe a 2D array or 2D vector would be better.

Possible output from above code is:

Welcome to COS1511 Flight Booking System

Enter full name : Etienne Navarre

The available travel times for flights are:
       Depart          Arrive
1.     07.00           09.30
2.     09.00           11.30
3.     11.00           13.30
4.     13.00           15.30
5.     15.00           17.30
6.     Exit
 Enter choice: a

     Invalid entry! Must be a number.

 Enter choice: 0

     Invalid choice! Try again.

 Enter choice: 9

     Invalid choice! Try again.

 Enter choice: 2

The available seats for 09.00 are as follows:

First Class (1920.00)
|A1|A2|A3| - - - - |A4|A5|A6|
|B1|B2|B3| - - - - |B4|B5|B6|
|C1|C2|C3| - - - - |C4|C5|C6|
|D1|D2|D3| - - - - |D4|D5|D6|

|Economy class (1600.00)
|E1|E2|E3| - - - - |E4|E5|E6|
|F1|F2|F3| - - - - |F4|F5|F6|
|G1|G2|G3| - - - - |G4|G5|G6|
|H1|H2|H3| - - - - |H4|H5|H6|
|I1|I2|
   Please Enter A Seat :


Notice the use of blank lines to break up the output. It makes it easier to read.

Andy
Hello Anonomys,

I think it is time to post the complete instructions for the program.

You are asking about a loop that you are not ready for yet.

The program needs some major thought about what you need to do.

What I am seeing is that you have 5 flights each with its own seating chart. That could mean a 3D array or an array of structs where the struct is a seating chart or 2D array of seats.

You would also need to check if a seat is already taken, someone might enter a wrong letter or number for a seat that may already be booked.

You would also need to keep track of the number of seats booked for a given flitht to know when a plane is full.

Not knowing what is called for these are just guesses for now.

Andy
yes thank you @handy andy the above explanation helped a lot , I knew what i wanted to do but wasn't sure how to put it. the next step is if the seat is already taken then it must be indicated with "**" and if it has "**" then a message must display saying "Seat already taken , choose a new 1" untill it works and after that I just need to make a whole new message that looks like a full ticket with persons name , flight time , location , thanking him or her and the price it costed. I will try to start doing that and thank you again
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#include <iostream>
#include <limits>
#include <string>

#include <utility>

using namespace std;

int main()
{
    constexpr int MINCHOICE{ 1 }, MAXCHOICE{ 6 };
    const string PROMPT{ "Choose the time by entering the option number from the displayed list : " };
    const string times[]
    {
        "",
        "07.00",
        "09.00",
        "11.00",
        "13.00",
        "15.00"
    };
    string name;
    int menuChoice{};
    string seat;

    cout <<
        "Welcome to COS1511 Flight Booking System\n\n"
        "Enter full name : ";
    getline(cin, name);

    cout <<
        "\n"
        "The available travel times for flights are:\n"
        "       Depart          Arrive\n"
        "1.     07.00           09.30\n"
        "2.     09.00           11.30\n"
        "3.     11.00           13.30\n"
        "4.     13.00           15.30\n"
        "5.     15.00           17.30\n"
        "6.     Exit\n";

    while (cout << PROMPT && !(cin >> menuChoice) || menuChoice < MINCHOICE || menuChoice > MAXCHOICE)
    {
        if (cin)
        {
            cout << "\n     Invalid entry! Must be a number.\n\n";

            cin.clear();
            cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
        }
        else if (menuChoice < MINCHOICE || menuChoice > MAXCHOICE)
        {
            cout << "\n     Invalid choice! Try again.\n\n";
        }
    }

    if (menuChoice == 1)
    {
        cout <<
            "\n"
            "The available seats for " << times[menuChoice] << " are as follows:\n\n";
    }
     if (menuChoice == 2)
    {
        cout <<
            "\n"
            "The available seats for " << times[menuChoice] << " are as follows:\n\n";
    }
     if (menuChoice == 3)
    {
        cout <<
            "\n"
            "The available seats for " << times[menuChoice] << " are as follows:\n\n";
    }
     if (menuChoice == 4)
    {
        cout <<
            "\n"
            "The available seats for " << times[menuChoice] << " are as follows:\n\n";
    }
     if (menuChoice == 5)
    {
        cout <<
            "\n"
            "The available seats for " << times[menuChoice] << " are as follows:\n\n";
    }

    if (menuChoice < 6)
    {
        cout <<
            "First Class (1920.00)\n"
            "|A1|A2|A3| - - - - |A4|A5|A6|\n"
            "|B1|B2|B3| - - - - |B4|B5|B6|\n"
            "|C1|C2|C3| - - - - |C4|C5|C6|\n"
            "|D1|D2|D3| - - - - |D4|D5|D6|\n\n"
            "|Economy class (1600.00)\n"
            "|E1|E2|E3| - - - - |E4|E5|E6|\n"
            "|F1|F2|F3| - - - - |F4|F5|F6|\n"
            "|G1|G2|G3| - - - - |G4|G5|G6|\n"
            "|H1|H2|H3| - - - - |H4|H5|H6|\n"
            "|I1|I2|\n"
            "      Please Enter A Seat : ";
        cin >> seat;

    }

     cout <<
            "***************************************************************************************\n"
            "              TRAVEL             TICKET               FOR              FLIGHT\n"
            "***************************************************************************************\n"
            "Name              :   "<<name << endl;
    cout << "                                           Travel Ticket class : \n" //Has to tell if its between A1-D6 its First Class If Not = Economy Class
            "                                           Seat No             : "<<seat << endl;
    cout << "Departure         :   Johannesburg         Departure Time      : "<<timesDeparture << endl; //Has to tell if its option 1 then start the flight at 7.00
    cout << "Destination       :   Cape Town            Arrival Time        : "<<timesArrival << endl;//Has to tell if its option 1 then it end the flight at 9.30
    cout << "***************************************************************************************\n"
            "Amount:  \n"//if first class =R1920.00 if economy = R1600.00
            "Thank you for booking with COS1511. Your travel agent for queries is Annie Mathew\n"
            "***************************************************************************************";

    return 0;
}


This is how it looks atm , what I must do is the above Comments I typed in the code and then I just need to loop this WHOLE code. So lets say it gives that ticket I just made at the end then it must make an "**" at the BOOKED seat that was previously booked and then a prompt question must come saying "Do you want another booking" if its "YES" then the whole thing starts over and the booked seat is no more,and if a person wants to book the booked seat a message must come saying its already booked choose another.



also this would work?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 const string timesDeparture[]
    {
        "",
        "07.00",
        "09.00",
        "11.00",
        "13.00",
        "15.00"
    };
    const string timesArrival[]
    {
        "",
        "9.30",
        "11.30",
        "13.30",
        "15.30",
        "17.30",
    };


I fixed it to look like this

1
2
3
4
5
6
7
8
9
10
11
12
13
    cout <<
            "***************************************************************************************\n"
            "              TRAVEL             TICKET               FOR              FLIGHT\n"
            "***************************************************************************************\n"
            "Name              :   "<<name << endl;
    cout << "                                           Travel Ticket class : \n" //Has to tell if its between A1-D6 its First Class If Not = Economy Class
            "                                           Seat No             : "<<seat << endl;
    cout << "Departure         :   Johannesburg         Departure Time      : "<<timesDeparture[menuChoice] << endl;
    cout << "Destination       :   Cape Town            Arrival Time        : "<<timesArrival[menuChoice] << endl;
    cout << "***************************************************************************************\n"
            "Amount:  \n"//if first class =R1920.00 if economy = R1600.00
            "Thank you for booking with COS1511. Your travel agent for queries is Annie Mathew\n"
            "***************************************************************************************";
Last edited on
Do I have to make Economy and First class x2 variables and then the range of each is A1 --> D6 and E1 --> I2? then if Economy == R1600.00 and if First Class == R1920.00?
Hello Anonomys,

Looking over your latest code gives me a better idea of what you need.

What I do not know is what you Ihave learned and what you can use.

I do not know if this will work for you, but I created a struct to contain a variable to keep track of the seats left and a 2D array of the seats.

Then in "main" I defined an array of the structs, so that each element corresponds to each of the flights. This way you can book a seat on any flight and the seat chosen will not affect any of the other flights.

I do not know if you can use functions yet, but I created a function that can print out the seats for any given flight.

At the moment it looks like this:

Welcome to COS1511 Flight Booking System

Enter full name: Etienne Navarre

The available travel times for flights are:
       Depart          Arrive
1.     07.00           09.30
2.     09.00           11.30
3.     11.00           13.30
4.     13.00           15.30
5.     15.00           17.30
6.     Exit
 Enter choice: 2

The available seats for departure time of 09.00 are as follows:

First Class (1920.00):
|A1|A2|A3| - - - - |A4|A5|A6|
|B1|B2|B3| - - - - |B4|B5|B6|
|C1|C2|C3| - - - - |C4|C5|C6|
|D1|D2|D3| - - - - |D4|D5|D6|

Economy class (1600.00):
|E1|E2|E3| - - - - |E4|E5|E6|
|F1|F2|F3| - - - - |F4|F5|F6|
|G1|G2|G3| - - - - |G4|G5|G6|
|H1|H2|H3| - - - - |H4|H5|H6|
|I1|I2|##| - - - - |##|##|##|
  There are 50 left on the plane.
   Please Enter A Seat: e3



The available seats for departure time of 09.00 are as follows:

First Class (1920.00):
|A1|A2|A3| - - - - |A4|A5|A6|
|B1|B2|B3| - - - - |B4|B5|B6|
|C1|C2|C3| - - - - |C4|C5|C6|
|D1|D2|D3| - - - - |D4|D5|D6|

Economy class (1600.00):
|E1|E2|**| - - - - |E4|E5|E6|
|F1|F2|F3| - - - - |F4|F5|F6|
|G1|G2|G3| - - - - |G4|G5|G6|
|H1|H2|H3| - - - - |H4|H5|H6|
|I1|I2|##| - - - - |##|##|##|
  There are 49 left on the plane.


 Press Enter to continue:


Not sure what you want to do with line "I", so I used the "##" to mark an unavailable seat. You could use something else or spaces, but it makes the output easier to work with. Plus you can use the contents of those elements when checking if someone entered the wrong seat.

Sorry about leaving the header file "<utility>". I had a thought at one time of using "std::pair", but decided against it as it was not needed. You can remove the header file "<utility>".

I added some variables in "main" and changed the if statements to:
1
2
3
4
5
6
if (menuChoice == 1)
{
    departTime = times[menuChoice];

    idx = 0;
}


Following the last if statement:
1
2
3
4
5
6
7
8
9
10
11
12
13
    if (menuChoice == 6)
    {
        return 0;
    }

    if (menuChoice < 6)  // <--- This is temporary for now, but could be removed based on the last if statement.
    {
        DisplaySeats(flights, departTime, idx);

        cout << "   Please Enter A Seat: ";
        cin >> seat;

        seat[0] = static_cast<char>(std::toupper(static_cast<unsigned char>(seat[0])));        

Line 13 changes a lower case letter to upper case if needed. It saves on check each case later.

Let me know what you can use and I will see what I can come up with.

For now work in small steps and do not try to do everything at once or you may never get done in time. Compile often and test what you have done.

Here is a little trick to make things easier:
1
2
3
4
5
6
7
8
9
10
11
12
//string name;       // <--- May not cause an error, but still needs the header file "<string>".
std::string name{ "Etienne Navarre" };


//cout << 
//    "Welcome to COS1511 Flight Booking System\n\n"
//    "Enter full name: ";
//std::getline(std::cin, name);  // <--- Changed.

cout <<
    "Welcome to COS1511 Flight Booking System\n\n"
    "Enter full name: " << name << '\n';

Once you know that the code for entering a name works this allows you to skip that part and move on to the menu and the rest of the program.

When finished you can delete the added code or just reverse the comments in case you need it later.

Andy

P.S. meant to mention that the if statements would work better as a switch if you can use that.
Last edited on
Are you allowed to use things like classes and vectors?

Or are you limited to arrays?
1
2
3
4
5
6
7
8
const int NUM_FLIGHTS = 5;
const int SEAT_1CLASS_ROWS = 4;
const int SEAT_2CLASS_ROWS = 5;  // Row I is a special case
const int SEAT_ROWS = SEAT_1CLASS_ROWS + SEAT_2CLASS_ROWS;
const int SEAT_COLS = 6;  // Row I is a special case. 

// all seats start off unoccupied.
bool seats[NUM_FLIGHTS][SEAT_ROWS][SEAT_COLS] = {};


Functions to display a flight, book a seat or check a seat is available would all have the same basic signature of
 
void function(bool seatsOnFlight[SEAT_ROWS][SEAT_COLS]);


Eg
1
2
3
4
5
6
7
8
9
10
11
12
void show(bool seatsOnFlight[SEAT_ROWS][SEAT_COLS]) {
  for ( int r = 0 ; r < SEAT_ROWS ; r++ ) {
    for ( int c = 0 ; c < SEAT_COLS ; c++ ) {
      if ( seatsOnFlight[r][c] ) {
        cout << "*";
      } else {
        cout << " ";
      }
    }
    cout << "\n";
  }
}


Could be called from main as
1
2
// -1 because your choice is 1-based and arrays are 0-based.
show(seats[menuChoice-1]);  
To explain it easier , this is what must be done

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#include <iostream>
#include <limits>
#include <string>

using namespace std;

int main()
{
    constexpr int MINCHOICE{ 1 }, MAXCHOICE{ 6 };
    const string PROMPT{ "Choose the time by entering the option number from the displayed list : " };
    const string timesDeparture[]
    {
        "",
        "07.00",
        "09.00",
        "11.00",
        "13.00",
        "15.00"
    };
    const string timesArrival[]
    {
        "",
        "9.30",
        "11.30",
        "13.30",
        "15.30",
        "17.30",
    };
    string name;
    int menuChoice{};
    string seat;

    cout <<
        "Welcome to COS1511 Flight Booking System\n\n"
        "Enter full name : ";
    getline(cin, name);

    cout <<
        "\n"
        "The available travel times for flights are:\n"
        "       Depart          Arrive\n"
        "1.     07.00           09.30\n"
        "2.     09.00           11.30\n"
        "3.     11.00           13.30\n"
        "4.     13.00           15.30\n"
        "5.     15.00           17.30\n"
        "6.     Exit\n";

    while (std::cout << PROMPT && !(std::cin >> menuChoice) || menuChoice < MINCHOICE || menuChoice > MAXCHOICE)
    {
        if (!std::cin)
        {
            std::cout << "\n     Invalid entry! Must be a number.\n\n";

            std::cin.clear();
            std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');  
        }
        else if (menuChoice < MINCHOICE || menuChoice > MAXCHOICE)
        {
            std::cout << "\n     Invalid choice! Try again.\n\n";
        }
    }
    if (menuChoice == 1)
    {
        cout <<
            "\n"
            "The available seats for " << timesDeparture[menuChoice] << " are as follows:\n\n";
    }
     if (menuChoice == 2)
    {
        cout <<
            "\n"
            "The available seats for " << timesDeparture[menuChoice] << " are as follows:\n\n";
    }
     if (menuChoice == 3)
    {
        cout <<
            "\n"
            "The available seats for " << timesDeparture[menuChoice] << " are as follows:\n\n";
    }
     if (menuChoice == 4)
    {
        cout <<
            "\n"
            "The available seats for " << timesDeparture[menuChoice] << " are as follows:\n\n";
    }
     if (menuChoice == 5)
    {
        cout <<
            "\n"
            "The available seats for " << timesDeparture[menuChoice] << " are as follows:\n\n";
    }

    if (menuChoice < 6)
    {
        cout <<
            "First Class (1920.00)\n"
            "|A1|A2|A3| - - - - |A4|A5|A6|\n"
            "|B1|B2|B3| - - - - |B4|B5|B6|\n"
            "|C1|C2|C3| - - - - |C4|C5|C6|\n"
            "|D1|D2|D3| - - - - |D4|D5|D6|\n\n"
            "|Economy class (1600.00)\n"
            "|E1|E2|E3| - - - - |E4|E5|E6|\n"
            "|F1|F2|F3| - - - - |F4|F5|F6|\n"
            "|G1|G2|G3| - - - - |G4|G5|G6|\n"
            "|H1|H2|H3| - - - - |H4|H5|H6|\n"
            "|I1|I2|\n"
            "      Please Enter A Seat : ";
        cin >> seat;

    }

    cout <<
            "***************************************************************************************\n"
            "              TRAVEL             TICKET               FOR              FLIGHT\n"
            "***************************************************************************************\n"
            "Name              :   "<<name << endl;
    cout << "                                           Travel Ticket class : \n" //Has to tell if its between A1-D6 its First Class If Not = Economy Class
            "                                           Seat No             : "<<seat << endl;
    cout << "Departure         :   Johannesburg         Departure Time      : "<<timesDeparture[menuChoice] << endl;
    cout << "Destination       :   Cape Town            Arrival Time        : "<<timesArrival[menuChoice] << endl;
    cout << "***************************************************************************************\n"
            "Amount:  \n"//if first class =R1920.00 if economy = R1600.00
            "Thank you for booking with COS1511. Your travel agent for queries is Annie Mathew\n"
            "***************************************************************************************" << endl;
    cout << "Do you want to make another booking (Y/N)?";
    //Can pick up both Y and y or N and n , if its Y - Loop The whole thing and the choosen seat above becomes unavailable , if No - End Program and count how many bookings were made on what time


    cout << "Number of bookings made for 7.00 : \n"
            "Number of bookings made for 9.00 : \n"
            "Number of bookings made for 11.00 : \n"
            "Number of bookings made for 13.00 : \n"
            "Number of bookings made for 15.00 : \n";
    return 0;
}
Last edited on
Hello Anonomys,

Your code is a start, but needs major work to cover what you have said do far.

I am guessing that this is a school assignment?

If so you were given instructions of what the program should do and maybe what is expected to be used in the program. Or what can not be used in the program.

By not posting the instructions you are leaving yourself open to suggestions that are beyond what you know.

I wish I could say that your last code is a good start, but I can not because it is missing to many parts. Functions help a great deal if you can use them.

You have no way to mark or keep track of what seat has been booked, how many seats are left or if the plane is full.

The code says there are 5 different flights and each flight could have different seats booked. There is no way to keep track of this with the code that you have.

The program needs better planning instead of posting some code and asking how do I make this work.

Tell us what you have learned and what you can use, so that everyone will know what to work with.

Andy
To emphasise some points that Andu has made. Always design your program before you start to code. You should 'code from design' not 'code as design'. In cases like this as a minimum the design should detail the output, the input, the data structures used, a breakdown of the program into steps (and functions/classes if used) and the overall 'flow' through the program (how it's going to work at a high level).
Hello, thank you for the replies , its hard to say what I learned and what not since this module I learn c++ (beginners) and my next module its c++ that you must already know the beginner ( a bit more advanced, i did use vectors in my prev assignment code which we don't learn and doesn't look like it was a problem)

but

whats usable is

2 dimensional array
1 dimensional array
void function with value parameters
if loop
switch
do while
while loop
for loop
use of array as function

im not sure if we do strings but i did also use that on prev assignments
Here's a working flight booking system.
I've limited it to using structs (which you don't mention) and arrays.
I don't normally encourage the use of globals, but I've made SeatMap and Flights global because they're used by nearly every function.
Please note the extensive use of named constants which eliminate the need to change values in multiple places in the program.
You may want to tweak the appearance of the ticket.
I've broken the program into numerous functions which are small and easy to understand.
You should have no problem extending the program if you want or need to.
Some changes I would make:
- I would allow the cost of first class and economy seats vary by flight.
- I would keep track of the total revenue for each flight as well as the grand total.
- I would make the departure and arrival cities attributes of the Flights struct so that flights between different citties can be handled.
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

//
//  Constants
// 
//  Hard coded values are placed here so that they can be changed in one place.
//
const int SEATS_PER_ROW = 6;
const int MAX_ROWS = 9;     //  Includes row I
const int FIRST_CLASS_ROWS = 4;
const int MAX_FLIGHTS = 5;
const int LAST_ROW_SEATS = 2;
const int AISLE_COL = 3;
const int SEATS_PER_FLIGHT = (MAX_ROWS - 1) * SEATS_PER_ROW + LAST_ROW_SEATS;
const float COST_FIRST_CLASS = 1920.00;
const float COST_ECONOMY = 1600.00;

//
//  Structs
//
//  The SeatMap record the state of every seat.
//  A SeatMap exists for every flight.
//
struct SeatMap
{
    struct
    {
        bool col[SEATS_PER_ROW];
    } row[MAX_ROWS];
    int seats_sold;
};

struct Flight
{
    string      depart;
    string      arrive;
};

//
//  Globals
// 
//  Normally, the use of globals is discouraged, but in this case
//  these two arrays are used in nearly every function.
//

//  THere is one entry in the flights array for every flight.
const Flight flights[MAX_FLIGHTS] =
{   "07:00", "09:30",
    "09:00", "11:30",
    "11:00", "13:30",
    "13:00", "15:30",
    "15:00", "17:30" };
SeatMap seatmap[MAX_FLIGHTS] = {};    //  Init to false (unoccupied)

//  Display the available flights.
//  If a flight is sold out, should it be displayed?
void show_flights()
{
    cout << "The available travel times for flights are : " << endl;
    cout << "\tDepart\tArrive" << endl;
    for (int f = 0; f < MAX_FLIGHTS; f++)
        cout << f + 1 << "\t" << flights[f].depart << "\t" << flights[f].arrive << endl;
}

//  Returns 0 based flight index
int choose_flight()
{
    int f;      //  Flight number

    cout << "Choose the time by entering the option number from the displayed list : ";
    while (1)
    {
        cin >> f;
        if (f < 1 || f > MAX_FLIGHTS)
        {
            cout << "Incorrect Option! Please choose 1 - " << MAX_FLIGHTS << endl;
            continue;
        }
        if (seatmap[f - 1].seats_sold == SEATS_PER_FLIGHT)
        {
            cout << "That flight is full." << endl;
            continue;
        }
        return f - 1;       //  Convert to 0 based index
    };
}

//  Display one row in either economy or first class
//  Special provision is made for last row which has only two seats.
void display_row (SeatMap& seatmap, int r)
{
    int seats_per_row = SEATS_PER_ROW;
    char row = r + 'A';
    char col;

    if (r == MAX_ROWS - 1)
        seats_per_row = LAST_ROW_SEATS;      //  Special case for last row
    for (int c = 0; c < seats_per_row; c++)
    {
        row = r + 'A';      //  Convert to character
        col = c + '1';
        cout << row << setw(1) << col;
        //  cout << "\t|";
        if (seatmap.row[r].col[c])
            cout << "**|";      //  Occupied
        else
            cout << "__|";      //  Unoccupied
        if (c == AISLE_COL - 1)
            cout << "  |";      //  Draw the aisle
    }
    cout << endl;
}

void select_seat(SeatMap& seatmap, string & seat)
{
    int seats_per_row;
    char row;       //  row as a single character
    char col;       //  column as a single character
    const char last_row = MAX_ROWS + 'A' - 1;
    int r, c;

    while (1)
    {
        cout << "Select seat: ";
        cin >> seat;
        if (seat.size() != 2)
        {
            cout << "Invalid seat number.  Must be two characters" << endl;
            continue;
        }
        row = seat[0];
        row = toupper(row);
        if (row < 'A' || row > last_row)
        {
            cout << "Invalid seat number.  Row must be A - " << last_row << endl;
            continue;
        }
        r = row - 'A';      //  Onvert to index  A = 0
        //  Special case for last orw
        seats_per_row = (r == MAX_ROWS - 1) ? LAST_ROW_SEATS : SEATS_PER_ROW;
        col = seat[1];
        if (col < '1' || col > seats_per_row + '0')
        {
            cout << "Invalid seat number.  Col must be 1 - " << seats_per_row + '0' << endl;
            continue;
        }
        c = col - '1';      //  Convert to index
        if (seatmap.row[r].col[c])
        {
            cout << "That seat is occupied, please pick another" << endl;
            continue;
        }
        seatmap.row[r].col[c] = true;       //  Assign seat
        seatmap.seats_sold++;               //  Count the seat
        return;
    }
}

void display_seat_map(const Flight& flight, SeatMap& seatmap)
{
    int r;

    cout << "The available seats for " << flight.depart << " are as follows : " << endl;
    cout << "First Class (" << COST_FIRST_CLASS << ")" << endl;
    for (r = 0; r < FIRST_CLASS_ROWS; r++)
        display_row(seatmap, r);
    cout << "Economy class (" << COST_ECONOMY << ")" << endl;
    for (; r < MAX_ROWS; r++)
        display_row(seatmap, r);
}

void print_ticket(const string& name, int f, const string & seat)
{
    char row = seat[0];
    bool first_class = row - 'A' < FIRST_CLASS_ROWS;
    double amount;

    cout <<
        "*******************************************************************************\n"
        "              TRAVEL             TICKET               FOR              FLIGHT\n"
        "*******************************************************************************\n"
        "Name              :   " << name << endl;
    cout << "                                           Travel Ticket class : ";
    if (first_class)
        cout << "First Class" << endl;
    else
        cout << "Economy" << endl;
    cout << "                                           Seat No             : ";
    cout << seat << endl;
    cout << "Departure         :   Johannesburg         Departure Time      : " << flights[f].depart << endl;
    cout << "Destination       :   Cape Town            Arrival Time        : " << flights[f].arrive << endl;
    cout << "*******************************************************************************\n";
    cout << "Amount:  ";
    amount = (first_class) ? COST_FIRST_CLASS : COST_ECONOMY;
    cout << amount << endl;
    cout << "Thank you for booking with COS1511. Your travel agent for queries is Annie Mathew\n"
            "*******************************************************************************" << endl;
}

void sell_ticket()
{
    string  name;
    int     f;      //  Flight number
    string seat;

    cout << "Enter full name : ";
    getline(cin, name);
    show_flights();
    f = choose_flight();
    display_seat_map(flights[f], seatmap[f]);
    select_seat(seatmap[f], seat);
    print_ticket(name,f,seat);
}

int main()
{
    char another;

    cout << "Welcome to COS1511 Flight Booking System" << endl;
    do
    {
        sell_ticket();
        cout << "Sell another ticket (y/n)? ";
        cin >> another;
        another = toupper(another);
    } while (another == 'Y');
    //  Display seats sold for each flight
    for (int f = 0; f < MAX_FLIGHTS; f++)
        cout << "Flight " << f+1 << " seats sold: " << seatmap[f].seats_sold << endl;
    return 0;
}


edit: Fixed line 232
Last edited on
@AbstractionAnon that is EXACTLY what I wanted to do , thank you really much , i'll work on it to try and understand everything you did but for the basics i got it. Thank you again.


also i noticed


1
2
cout << "Enter full name : ";
    cin >> name ;
works instead of
1
2
    cout << "Enter full name : ";
    getline(cin, name);



and 1 last thing , the counting system at the end it doesn't count lets say they choose flight 1 like 3 times then it only counts it as one for some reason
Last edited on
std::cin works as long as there are no spaces in the input, that's why std::getline is used. For example, if one's family name is Di Masi, std::cin will only read "Di"

the counting system at the end it doesn't count lets say they choose flight 1 like 3 times then it only counts it as one for some reason

I'm not seeing that. See lines 156-157. When the seat is marked reserved, the counter is incremented. I booked 3 seats and got the following display:
1
2
3
4
5
6
Sell another ticket (y/n)? n
Flight 0 seats sold: 3
Flight 1 seats sold: 0
Flight 2 seats sold: 0
Flight 3 seats sold: 0
Flight 4 seats sold: 0

What I did notice is the flight numbers need to be incremented in the cout statement so so they display as 1-5. Line 232 should be:
 
    cout << "Flight " << f+1 << " seats sold: " << seatmap[f].seats_sold << endl;
ah sorry @AbstractionAnon I edited out

for (int f = 0; f < MAX_FLIGHTS; f++) thats why it didn't work :P sorry
Topic archived. No new replies allowed.