COMPSCI 2S03 Lecture Notes - Lecture 8: Flight Attendant, Primitive Data Type
Document Summary
Switch only works on char, int, byte, short, string (only expressions), boolean. Statements you can use inside loops: break and continue. Not good practice, needs to be structured differently if you can! Object oriented: abstract into classes, abstract problems into classes/objects. The whole point of oop is that your code replicates real world objects, thus making your code readable and maintainable. When we say real world, the real world has relationships. What are the relationships between the classes: manager is an employee of xyz limited corporation, manager uses a swipe card to enter xyz premises, manager has workers who work under him. A program that keeps track of flights at an airport has a flight class and an airplane class. A flight has a flight number, destination and departure date/time. I. d. (sort of like a vehicle vin that uniquely identifies on specified airplane), an airline name, airplane model (e. g. 747), and number of passengers.