Clases POO

1
Programaci´ on 2, 2014/2015 3 Container -idNextContainer: int -price: int -weight: double -id: int +Container() +Container(weight:double,price:int) +<<const>> getPrice(): int +<<const>> getWeight(): double +<<const>> getId(): int +<<const>> toString(): string +readData(): bool Hold -weight: double -price: int +Hold() +<<const>> getWeight(): double +<<const>> getPrice(): int +<<const>> size(): int +addContainer(c:const Container &): void +removeLastContainer(removedContainer:Container &): bool +<<const>> findContainer(id:int): int +removeContainer(position:int): bool +<<friend>> operator <<(os:ostream &,hold:const Hold &): ostream & -containers 0..* Passenger -GIN: string -name: string -price: int -seat: int -idLuggage: int +Passenger() +Passenger(GIN:string,name:string,price:int=1000) +<<const>> getGIN(): string +<<const>> getName(): string +<<const>> getPrice(): int +<<const>> getSeat(): int +<<const>> getIdLuggage(): int +setIdLuggage(idLuggage:int): void +setSeat(seat:int): void +readData(): bool +<<friend>> operator <<(os:ostream &,p:const Passenger &): ostream & Spaceship -name: string -captainName: string -seats[NUMPASSENGERS]: bool +Spaceship() +<<const>> getName(): string +<<const>> getCaptainName(): string +setName(name:string): void +setCaptainName(captainName:string): void +loadContainer(c:const Container &): void +unloadContainer(id:int): bool +loadBalancing(): void +addPassenger(p:Passenger &): void +deletePassenger(GIN:string): bool +travel(km:int): void +<<friend>> operator <<(os:ostream &,spaceShip:const Spaceship &): ostream & +<<const>> firstFreeSeat(): int +<<const>> freeSeats(): int +<<const>> numContainers(): int - holds 1 3 -passengers 0..* ShipManager +ShipManager(shipName:string,shipCaptainName:string) +loadContainer(): bool +unloadContainer(): bool +newPassenger(): bool +removePassenger(): bool +showData(): void +travel(): bool -ship 1 1

description

.5403

Transcript of Clases POO

  • Program

    acion

    2,20

    14/2

    015

    3

    Container-idNextContainer: int-price: int-weight: double-id: int

    +Container()+Container(weight:double,price:int)+ getPrice(): int+ getWeight(): double+ getId(): int+ toString(): string+readData(): bool

    Hold-weight: double-price: int

    +Hold()+ getWeight(): double+ getPrice(): int+ size(): int+addContainer(c:const Container &): void+removeLastContainer(removedContainer:Container &): bool+ findContainer(id:int): int+removeContainer(position:int): bool+ operator