This program will allow users to input personal information, the destination code and
quantity of tickets. This program should display the details of the chosen
destination/destinations once booking is completed. Due to the pandemic of Covid 19,
Selangor Airways will give a 10% discount for users with a total price more than
RM500.00.
(Note: Display an error message for any invalid destination code).
#include <iostream>
using namespace std;
struct student
{
char name[50];
int mobile;
float code;
} s[10];
int main()
{
cout << "Enter name: " << endl;
// storing information
for(int i = 0; i < 10; ++i)
{
s[i].roll = i+1;
cout << "For mobile" << s[i].roll << "," << endl;
cout << "Enter name: ";
cin >> s[i].name;
cout << "Enter marks: ";
cin >> s[i].marks;
cout << endl;
}
cout << "Displaying Information: " << endl;
// Displaying information
for(int i = 0; i < 10; ++i)
{
cout << "\nRoll number: " << i+1 << endl;
cout << "Name: " << s[i].name << endl;
cout << "Marks: " << s[i].marks << endl;
}
return 0;
}
Comments
Leave a comment