Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS201 Introduction to Programming Assignment No 5 Solution fall January 2012
#1
Problem Statement: Airline Fare System

Write a program for air fare System which will calculate fare on already reserved ticket.

Detailed Description:

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

ñ Seat type

ñ Price

ñ Tax

ñ Airline charges

In the main () function, create a constructor of class to initialize the class data members. Class must have a destructor. Create following user defined function as discussed below along with class constructors and destructor:

GetData(), this function will take the input for seat type variable from the user and will set the ticket price according to the input taken from user. The function GetData() will prompt user to enter required information for seat type.

Seat Type:

User can select one of the Seat type:

1. First Class Seat

2. Business Class Seat

3. Economy Class Seat

The function GetData() will also read the data from file named data.txt ( created in assignment no 3 ) to read the destination and then assigns the price for the given destination.

Price:

Price will be calculated on the basis of following information:

1- Fare type

2- Destination (Desire destination information will be read from the file “data.txt” )

The price will be assigned according to the table given below:

Seat Type

Destination

Ticket Price

Economy Class

Karachi

3000

Economy Class

Peshawar

2500

Economy Class

Lahore

4000

Business Class

Karachi

5000

Business Class

Peshawar

4500

Business Class

Lahore

6000

First Class

Karachi

7000

First Class

Peshawar

7000

First Class

Lahore

7000

Airline charges:

All airlines will charge 15% of ticket price extra to the all fare types along with the tax.

Class should have a user-defined function named CalculateTax() to calculate the tax according to seat type and ticket price.

Tax calculation will be done as below:

If seat type is First class then tax will be 30% of ticket price

If seat type is Business class then tax will be 20% of ticket price

If seat type if Economy class then tax will be 10% of ticket price

Calculateprice(), this member function will calculate price of already reserved ticket and will display total fare on the screen. Price calculation will add above calculated tax, airline charges to the actual ticket price according to following information.

Fare = Airline Charges + Tax + Ticket Price

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

------------------------------------------------------------------------

Name | Address| Date | Destination | Flight. No | Seat. No | Fare

------------------------------------------------------------------------.

.

.

.

.

.

.

------------------------------------------------------------------------

Required information of Name, Address, Date, Destination, Flight No, Seat No, should be taken from assignment no 3 output file.

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.


0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply
#2
any body share here idea solution of assignment 5 cs201
Reply
#3
cs201 solution 5th assignment 2012 click on this link

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,319 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,904 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,924 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,159 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,237 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 1,962 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,658 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,793 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,695 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,794 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)