100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Overig

COS1511 ASSIGNMENT3 2021 MEMO

Beoordeling
-
Verkocht
2
Pagina's
23
Geüpload op
26-08-2021
Geschreven in
2021/2022

COS1511 ASSIGNMENT3 2021 MEMO

Instelling
Vak










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
26 augustus 2021
Aantal pagina's
23
Geschreven in
2021/2022
Type
Overig
Persoon
Onbekend

Onderwerpen

Voorbeeld van de inhoud

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) )
{
€13,96
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
ExcellingStudent

Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
ExcellingStudent University of South Africa (Unisa)
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
2
Lid sinds
4 jaar
Aantal volgers
2
Documenten
4
Laatst verkocht
4 jaar geleden

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen