Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

COS1511 Assignment 4 2022

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
07-06-2022
Written in
2021/2022

COS1511 Assignment % TRUSTED workings, explanations and solutions. +94 for assistance

Institution
Course

Content preview

AILADA COLLEGE
For Assistance with other modules
Call or Whatsapp +27682021794




*********************
COS1511
Assignment 04
2022

*********************
Due date
26 September 2022

COS1511 Assignment 4 2022 100% TRUSTED workings, explanations and solutions.
Whatsapp +27682021794 for assistance




1

, QUESTION 1
#include <iostream>
#include <iomanip>
#include <string>

using namespace

std;

const int NUM = 10;
const float FLIGHT = 1600.00;
const float F_TIMES[5][2] = {{7.00,9.30}, {9.00,11.30},{11.00,13.30},
{13.00,15.30},{15.00,17.30}};

struct travelBooking
{
string
travellerName;
string travelClass;
float departureTime;
float arrivalTime;
string seatNo;
};

bool validateTimeOption(int opt)
{
if(opt == 1 || opt == 2 || opt == 3 || opt == 4 || opt ==
5) return true;
else
return false;
}

bool validateSeat(travelBooking t[], string sNo, int timeChoice)
{
bool notBooked =
true; float dTime;
dTime = F_TIMES[timeChoice -
1][0]; int i = 0;

//check if it is already
booked while(i < NUM)
{
if(t[i].seatNo == sNo && t[i].departureTime == dTime)
{
notBooked =
false; break;
}
i++;
}




2

Written for

Institution
Course

Document information

Uploaded on
June 7, 2022
Number of pages
8
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$3.12
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ailada stuvia seller
Follow You need to be logged in order to follow users or courses
Sold
49
Member since
4 year
Number of followers
50
Documents
0
Last sold
3 year ago
Ailada

2.7

6 reviews

5
1
4
1
3
1
2
1
1
2

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions