php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS201 Introduction to ProgrammingAssignment No. 03 Semester Fall 23 December 2011
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
Problem Statement: Flight Reservation System

Write a program for Flight Reservation System which reserves the tickets for passengers of an Air Line according to their requirements.

Detailed Description:

In the program, you are required to make a structure with name 'Reservation' and following are the data members of structure.

 Passenger Name
 Passenger Address
 Date of flight
 Destination to travel
 Flight No
 Seat No

In the main() function, create of variable of type Reservation. The variable of type Reservation should be created dynamically using memory allocation function. After that, create following user defined function as discussed below:

GetData(), this function will set the values of above created structure variable according to the inputs taken from user. It will prompt user to enter required information for the, Passenger Name, Passenger Address, Destination, Date of flight. User will be provided three options for the destination that is: Karachi, Lahore and Peshawar.

Assigning Flight No and Seat No:

The user will chose one of three destinations and program will assign an appropriate Flight No for the passenger. The Flight No will be assigned as below:

Destination Flight No.
Karachi 201
Peshawar 233
Lahore 241

After Assigning Flight No, the Seat No. will be assigned randomly which can be any number from 0 to 200.

After assigning the values for the above created variable of Reservation structure, the structure will be passed to another user defined function WriteData() for writing it to the file.


In the function WriteData(), you are required to create a new text file name “data.txt” in same folder/directory where you have saved your .cpp file. Open this file by using file handling functions and then write all Reservation information in that file.

At the end, read all the data from file by creating a function named ReadData() and display the file contents on the screen.


Points To Remember:

Following points should be kept in mind and handled accordingly, otherwise marks will be deducted.

 Reading and writing from text file, must be done with standard file handling functions provided in handouts.
 All data members must be declared and initialized with appropriate data type.
 Exceptional cases must be kept in mind and handled accordingly while taking input from user.
 User must be prompted if there is any error while:

◦ Creating a file.
◦ Opening a file for reading/ writing.


Attached Files
.doc   Fall 2011_CS201_3.doc (Size: 281.5 KB / Downloads: 124)

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Messages In This Thread
CS201 Introduction to ProgrammingAssignment No. 03 Semester Fall 23 December 2011 - by Vuhelper - 12-23-2011, 08:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Assignment No. 3 Semester: Spring 2015 Computer Network- CS610 Xpert 0 924 07-29-2015, 04:45 PM
Last Post: Xpert
  cs402 first semester first assignment spring may 2015 Xpert 0 2,866 05-15-2015, 03:39 AM
Last Post: Xpert
  mcs cs408 assignment no 1 for may spring 2015 semester for virtual university Xpert 0 1,756 05-15-2015, 03:28 AM
Last Post: Xpert
  first semester assignment of cs604 spring may 2015 with final solution 2015 Xpert 0 2,721 05-15-2015, 03:20 AM
Last Post: Xpert
  cs304 first may spring semester for mcs 2015 final solution Xpert 0 1,233 05-15-2015, 03:11 AM
Last Post: Xpert
  cs201 assignment no 1 may 2015 solution Xpert 0 3,043 05-15-2015, 03:06 AM
Last Post: Xpert
  Virtual university MCS online tuition and helping forum for fall 2014 Semester Xpert 0 1,328 09-28-2014, 05:19 PM
Last Post: Xpert
  CS507 Information System Assignment No. 03 Solution Spring Semester June 2013 Vuhelper 6 2,343 06-21-2013, 04:11 AM
Last Post: Xpert
  ECO402 Microeconomics Assignment No.2 Solution Spring Semester 2013 Vuhelper 0 2,889 06-20-2013, 10:08 PM
Last Post: Vuhelper
  CS302 Digital Logic Design Assignment No.3 Solution Spring Semester 2013 Vuhelper 0 3,498 06-20-2013, 04:53 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support