100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Other

COS1511 ASSIGNMENT3 2021 MEMO

Rating
-
Sold
2
Pages
23
Uploaded on
26-08-2021
Written in
2021/2022

COS1511 ASSIGNMENT3 2021 MEMO

Institution
Module










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Module

Document information

Uploaded on
August 26, 2021
Number of pages
23
Written in
2021/2022
Type
Other
Person
Unknown

Subjects

Content preview

8.8 Assignment 3
SUBMISSION: Electronically via myUnisa
Please note that we automatically give four days extension for this aassignment. It will be
to your own advantage to check after a few days whether the assignment has been registered
on the system. If you have not completed the assignment by the extension date, submit
whatever you have completed – you will get marks for everything that you have done.
If myUnisa is off-line when you want to submit the assignment, you need not contact us, because
we will be aware of it. Simply submit it as soon as myUnisa is available again.

DUE DATE 31 August 2021

UNIQUE NUMBER 841712

EXTENSION No extension

TUTORIAL MATTER Study Guide, Lessons 1 – 30

CONTRIBUTION WEIGHT TO 30%
SEMESTER MARK
QUESTIONS Practical exercises



IS YOUR SOFTWARE INSTALLED?
If you struggle to install the software, please contact your e-tutor.



Introduction
You are required to write a program that simulates a flight booking system.

A sample program execution is provided at the end of the document, to help you visualize and understand what the program
should do. You should use the same input as the sample program, for the screenshots that you submit with your assignment.
The flight route is from Johannesburg to Cape Town with the travel duration fixed at 2 ½ hours.
o Departure and arrival locations remain the same.
o Departure is always from Johannesburg and destination is always Cape Town.
The departure and arrival times are:
Option Departure Time Arrival Time
1 7:00 9:30
2 9:00 11:30
3 11:00 13:30
4 13:00 15:30
5 15:00 17:30

The seating arrangement is six seats in a row, three on the left side and three on the right side of the plane with a walkway
(passage) in between. See the image of the setup below.




41

,Assignment 3:

Program:

//Flight booking system.
#include <iostream>
#include <string>
using namespace std;
const int col_Num = 6;
const char row_A_H = 9;
const int Dep_Arr = 2;
const int NUM_Opt = 5;
const int TAG_WIDTH = 21 , Class_Border = 4;
float FirstFlyTime = 7.00;
struct TicketInfo
{
string name, flight,departure, destination,Class,SeatNO;
float time[Dep_Arr];
int choice_Time, choice_Seat,tracker[NUM_Opt];
};
//________Displaying Fyight Schedule time from Depature to Arrival__
void LoadingScheduleTime(float SceduleP[][Dep_Arr])
{
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 2; j++)
SceduleP[i][j] = FirstFlyTime + 2*i +j*2.30;
}
}
//_______Input__and ___Validation of the Input Number if is an Intiger_________
Put_validateNumberisNotLetter(int & Num)
{
while(!( cin >> Num ) )
{
cout << "Error is not a Number" << endl;
cout << "Enter again: ";
cin.clear();
cin.ignore(100, '\n');
}
return Num;
}
//_______Converting Number to String and Asteris_**____________________________
string CombineLetterAndNumber( int ArraySitLetter, int ArraySitNumber)
{

, char rowOFletters ;
int colOFnumbers ;
string sitNumber = "";
rowOFletters = ArraySitLetter + 65;
colOFnumbers = ArraySitNumber + 49;
sitNumber += rowOFletters ;
sitNumber += colOFnumbers ;
return sitNumber;
}
//_______Validate_if_Number is on the_range_1_5_____
validadeNumberRange(int & One_FiveP)
{
while (One_FiveP <= 0 || One_FiveP > NUM_Opt )
{
cout << "Incorrect option! Please choose from 1-5." << endl;
cout << "Enter again: ";
cin.clear();
cin.ignore(100, '\n');
cin >> One_FiveP;
cin.clear();
cin.ignore(100,'\n');
}
return One_FiveP;
}
// find numerical index of row
int charToNumber(char L)
{
return toupper(L) - 'A'; // 0, 1, 2, 3, or 4 will be returned
}
//______Change the Char_to _Upper_Letter_______
void charToUpperChase(char & c)
{
c = toupper(c);
}
// Display the Character as requested
void displayChars(char c, int i)
{
for (int j = 0; j < i; j++)
cout << c;
}
//______Input_The _Letter_and _Number_for _Seat_Number_and_Validate it_______
void validateLetterAndNumber(char & CHAR, int & INTN)
{
while(!( cin >> CHAR && cin >> INTN) )
{
£12.13
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
ExcellingStudent

Also available in package deal

Get to know the seller

Seller avatar
ExcellingStudent University of South Africa (Unisa)
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
4 year
Number of followers
2
Documents
4
Last sold
4 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions