Earn in Dollars

PaidVerts


CS301 Assignment No 01 Solution & Discussion Due Date November 23, 2015


CS301 - Data Structures Assignment No. 01 Solution Fall 2015 Due Date November 23, 2015
Assignment No. 01 (Graded)
Total Marks: 20

Semester: Fall 2015
Due Date: 23/ 11/2015

CS301: Data Structures
Lectures covered: 1 to 9



Please read the following instructions carefully before submitting assignment.

It should be clear that your assignment will not get any credit if:

ü  The assignment is submitted after due date.

ü  The submitted assignment does not open or file is corrupt.

ü  Assignment is copied(partial or full) from any source (websites, forums, students, etc)

ü  Assignment implemented by other data structures except link list

Uploading Instruction:

For clarity and simplicity, you are required to Upload/Submit only .cpp file.

Note: Use only Dev-C++ IDE.

Objective:

The objectives of this assignment are:-

ü  Practice on the implementation of link list data structure

ü  Learn to use string manipulation functions

Guidelines:

ü  Code should properly be indented and well commented.

ü  Follow C/C++ naming conventions while using variables, functions etc.

Problem Statement:

A national security firm is interested in local flights schedule on daily basis. The security firm checks each flight for security clearness. It gets details for each correspondence flight to and from a specific city.

Figure 1:


Flight No.
From
To
Departure Time
Arrival Time


PK-1781
Karachi (KHI)
Islamabad (ISB)
19:00
21:00


PK-368
Islamabad (ISB)
Karachi (KHI)
21:45
23:45


PK-688
Peshawar (PEW)
Karachi (KHI)
08:15
10:15


PK-368
Karachi (KHI)
Lahore (LHE)
13:15
15:00


PK-308
Lahore (LHE)
Karachi (KHI)
15:45
17:30


PK-370
Lahore ( LHE)
Karachi (KHI)
21:00
22:45


16103
Karachi (KHI)
Peshawar (PEW)
08:00
09:50


16104
Karachi (KHI)
Islamabad (ISB)
19:30
21:30

16401
Karachi (KHI)
Islamabad (ISB)
20:00
22:00


16402
Karachi (KHI)
Islamabad (ISB)
19:55
21:55


Keeping in view the above scenario, write a program in C++ that will store and display flights details (Flight No, From, To, departure Time, Arrival Time). Further, your program should contain a function to find and display flight’s information between two locations or “No flights found” message if flights are not found.

E.g.

Please enter flight from: KHI Please enter flight to: ISB

The flight details from KHI to ISB are shown in figure 2:-

Figure 2:

Flight No.
From
To
Departure Time
Arrival Time
PK-1781
Karachi (KHI)
Islamabad (ISB)
19:00
21:00
16104
Karachi (KHI)
Islamabad (ISB)
19:30
21:30
16401
Karachi (KHI)
Islamabad (ISB)
20:00
22:00
16402
Karachi (KHI)
Islamabad (ISB)
19:55
21:55

Solution Guidelines

ü    Use Linked List to implement above scenario.

ü    Your solution should contain the following two classes:

  1. Flight class

  1. FlightDetail class

ü    Flight class should contain constructors, setter and getter functions.

ü  Create a list of flights (as shown in figure 1) and store each flight’s information in the FlightDetail list.

ü    Display each flight’s information as given in simple output.

ü                               Find and display flight’s information between two locations or “No flights found” message,   if

flights are not found.
(Note: Use only city codes for search, i.e. KHI for Karachi, ISB for Islamabad and so on)

ü                               Keep both Flight and FlightDetail classes in a single solution file(i.e your assignment file will be

single .cpp file containing both these classes) 


Solution

complete solution available here:  http://q.gs/9R7Go
 
Top