hyper dawg
February 4th, 2003, 07:45 AM
i have an algoritm here for reserving a seat on a plane ...having trouble codding it....
//function to reserve a seat in first class which has 5 rows with 4 seats in each row....a seat is defined by its row number and column letter E.G........ function must return 1 or 0 if successfull
A B---C D
FUNCTION PROTOTYPE
reserve(int row,char col,char* travelclass)
algorithm
1. for the travel class being FIRSTCLASS
print 'welcome'
print 'passengers name'
enter name
print 'passengers surname'
enter sname
enter a valid row number
enter a valid column
if status is equal to unreserved
assign row and column to passengers name
print 'seat---- is reserved by-----
else
print'seat is already taken
END
any help would be deeply appreciated
//function to reserve a seat in first class which has 5 rows with 4 seats in each row....a seat is defined by its row number and column letter E.G........ function must return 1 or 0 if successfull
A B---C D
FUNCTION PROTOTYPE
reserve(int row,char col,char* travelclass)
algorithm
1. for the travel class being FIRSTCLASS
print 'welcome'
print 'passengers name'
enter name
print 'passengers surname'
enter sname
enter a valid row number
enter a valid column
if status is equal to unreserved
assign row and column to passengers name
print 'seat---- is reserved by-----
else
print'seat is already taken
END
any help would be deeply appreciated