Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Reservas de Passagens Aéreas

No description
by

Rodrigo Freitas

on 13 December 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Reservas de Passagens Aéreas

Reservas de Passagens Aéreas
Diagrama de Classes
FRAirport
FRAirline
FRSeat
Desafio 3
FRFlight
@interface FRAirport : NSObject

- (NSString*)getIdentifire;
- (void)setIdentifire:(NSString*)newIdentifire;
- (id)initWithIdentifire:(NSString *)newIdentifire;

@end
@implementation FRAirport
{
NSString *identifire;
}

- (NSString*)getIdentifire
{
return [identifire copy];
}

- (void)setIdentifire:(NSString*)newIdentifire
{

if ([identifire length] == 3)
{
identifire = [[identifire uppercaseString] copy];
}
}
@interface FRAirline : NSObject

- (void) setName: (NSString * ) aname;
- (NSString *) getName;
- (id) initWithName: (NSString *) aName;
- (void) newFlight: (FRFlight *) flight;

@end
@implementation FRAirline
{
NSString *name;
NSMutableArray *flights;
}
-(id) initWithName:(NSString *) aName
{
self = [super init];
if (self)
{
[self setName: [aName copy]];
flights = [[NSMutableArray alloc] init];
}
return self;
}

-(void) newFlight: (FRFlight *) flight
{
[flights addObject:flight];
}

-(void) setName: (NSString * ) aname
{
if ([aname length] <= 6)
name = [aname copy];
}
@end
@interface FRSeat : NSObject

@property (nonatomic, readwrite) NSInteger row;
@property (nonatomic, readwrite) char col;
@property (nonatomic, readwrite) BOOL reserved;

@end
@implementation FRSeat


-(instancetype)initWithRow:(char)newCol
WithLine:(NSInteger)newRow
WithReserved:(BOOL)newReserved
{
self = [super init];

if (self)
{
[self setCol:newCol];
[self setRow:newRow];
[self setReserved:newReserved];
}

return self;
}
@interface FRFlight : NSObject

@property (nonatomic) NSString *name;
@property (nonatomic) NSString *identifier;
@property (nonatomic) FRAirport *departureAirport;
@property (nonatomic) FRAirport *arrivalAirport;
@property (nonatomic) NSDate *arrivalDate;

- (void) addSeatsWithCategory:(FRSEATCLASS) category
lines:(NSInteger) numLines
andRows:(NSInteger) numRows;


- (id)initWithIdentifier: (NSString *) newIdentifier
WithDepartureAirport: (FRAirport *) newDepartureAirport
WithArrivalAirport: (FRAirport *) newArrivalAirport
WithArrivalDate: (NSDate *) newArrivalDate
WithName: (NSString *) aname;

@end
@implementation FRFlight
{
NSDictionary *categories;
}

- (void) addSeatsWithCategory:(FRSEATCLASS) category
lines:(NSInteger) numLines
andRows:(NSInteger) numRows
{
NSMutableArray *seats = [[NSMutableArray alloc] init];

for (int i=0; i < numLines; i++)
[seats addObject:[[NSMutableArray alloc] initWithCapacity:numRows]];

for (int i=0; i < numLines; i++)
for (int j=0; j < numRows; j++)
seats[i][j] = [[FRSeat alloc] init];
}
@end
FRSystemManager

#import "FRSeatClass.h"

@interface FRSystemManager : NSObject


- (void) createAirport: (NSString *) aname;

- (void) createAirline: (NSString *) aname;

- (void) createFlight: (NSString *) aname
: (NSString *) orig
: (NSString *) dest
: (int ) year
: (int ) month
: (int ) day
: (NSString *) identifier;


- (void) createSection: (NSString *) air
: (NSString *) flID
: (NSInteger ) rows
: (NSInteger ) cols
: (FRSEATCLASS ) SeatClass; // Adicionar classe de assento

- (void) findAvailableFlights: (NSString *) orig
: (NSString *) dest;

- (void) bookSeat: (NSString *) air
: (NSString *) fl
: (FRSEATCLASS ) SeatClass // Adicionar classe de assento
: (NSInteger ) row
: (NSInteger ) col;

- (void) displaySystemDetails;



@end
Full transcript