CSC-113-Lab.12 - Vehicule(String boolean...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
KSU / CCIS / CS DEPARTMENT CSC-113, SPRING 2010 LAB 12 LINKED LISTS Translate the following UML classes into Java. Class Vehicle : isSimilar(v:Vehicle): boolean For cars, returns true if the vehicle has the same number of cylinders. For buses, returns true if the vehicle has the same number of seats. 1 First List - name: String + List(s: String) + size(): int + insertAtFront(d: Vehicle) + getElement(i:int): Vehicle + remove():List + displaySimilars(obj: Vehicle) Node - data: Vehicle - next: Node + Node(d: Vehicle) + Node(n: Node) + setNext(n: Node) + getNext(): Node + getData(): Vehicle suB - nbSeats: int + Bus (String, boolean, int) + Bus (Bus) raC - nbCylinders: int + Car (String, boolean, int) + Car (Car) Vehicle # name: String # available: boolean
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: + Vehicule (String, boolean) + isSimilar(v:Vehicle):boolean Class List:-displaySimilars(obj: Vehicle) display all the elements similar to obj.-remove():List returns the list of elements removed based on the condition of the deletion. Bus Station :-addBus(b: Bus) : adds a bus.-removeNotAvailable():List returns the list of vehicles removed that are not available to be used -countSimilarBus(b: Bus): int returns the number of buses that have the same number of seats. 1 List- name: String + List(s: String) + size(): int + insertAtFront(d: Vehicle) + getElement(i:int): Vehicle + remove():int LV BusStation-name: String + BusStation (n1: String, n2: String) + addBus (b: Bus) +removeNotAvaible():List + countSimilarBus( b: Bus): int...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern