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











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

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) )
{
R259,00
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

Document also available in package deal

Thumbnail
Package deal
COS1511 ASSIGNMENT 3 & 4 2021 MEMO(s)
-
2 2021
R 518,00 More info

Get to know the seller

Seller avatar
ExcellingStudent University of South Africa (Unisa)
View profile
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 notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

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

Student with book image

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

Alisha Student

Frequently asked questions