Sie sind auf Seite 1von 2

DHA Suffa University

CS 103 Object Oriented Programming


Spring 2016
Assignment 01
Submission Deadline: Saturday, 27th February, 2016; before midnight
Other Submission Details: Programming Assignment Submission Instructions.pdf
Assignment #01
Note: Make sure you submit your own work. Any form of collaboration will not be tolerated and case will be
forwarded directly to the Disciplinary Committee or in the best case, -100 policy (Remember?). You may discuss
the algorithm logic with your friends/classmates verbally OR visually, but not share your code. All in all, NEVER
LOOK INTO SOMEONE ELSES CODE else both will be penalized!

Welcome back. Hopefully you have understood the problem and how to map it as a 2D array. Following
is the table of flights that you will be working on:

Source

Destination

Karachi
Lahore
Islamabad
Peshawar
Quetta
Sialkot
Multan

Karachi
N/A
100
130
150
60
120
N/A

Lahore
100
N/A
50
N/A
N/A
30
N/A

Islamabad
130
50
N/A
50
120
70
45

Peshawar
150
60
50
N/A
N/A
140
N/A

Quetta
60
130
120
140
N/A
150
85

Sialkot
N/A
N/A
70
140
N/A
N/A
25

Multan
N/A
N/A
55
N/A
N/A
N/A
N/A

You have to modify your input files (durations.txt and cities.txt) according to this new table now and
then read them programmatically.
You will be solving the following queries regarding the flights. Each query will be solved by a separate
function declared in the header file flight.h (posted with this assignment):
1) Which city has the shortest duration flight from a given source city?
2) Which city has the longest duration flight from a given source city?
3) Which cities have flight duration less than x minutes from a given source city, where x and source city
are given?
4) Which city has the maximum number of incoming flights?
5) Which city is introvert i.e. minimum number of outgoing flights?

You are required to define all functions given in the flight.h file in flight.cpp. For now create your own
driver file, however we will test your functions by using our own driver files. Note that all input and
output must be done through filing. So there should be no cins and couts in your program.

Best of luck!

Das könnte Ihnen auch gefallen