Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Lab3_Task2 {
- public static void main(String[] args) {
- //Konstruerar en ny scanner
- Scanner inp = new Scanner(System.in);
- //Skapar två objekt av typen Airplane
- Lab3_Airplane plane1 = new Lab3_Airplane(12000, 3, 400, "Boeing 777");
- Lab3_Airplane plane2 = new Lab3_Airplane(14000, 2, 500, "Airbus A380");
- //Skriver ut all data
- System.out.println("Airplane model: " + plane1.getModel());
- System.out.println("Current speed: " + plane1.getSpeed());
- System.out.println("Current direction: " + plane1.getDirection());
- System.out.println("Current attitude: " + plane1.getHeight() + "ft.\n");
- System.out.println("Airplane model: " + plane2.getModel());
- System.out.println("Current speed: " + plane2.getSpeed());
- System.out.println("Current direction: " + plane2.getDirection());
- System.out.println("Current attitude: " + plane2.getHeight() + "ft.");
- }
- }
- Airplane model: Airbus A380
- Current speed: 500
- Current direction: South
- Current attitude: 14000ft.
- Airplane model: Airbus A380
- Current speed: 500
- Current direction: South
- Current attitude: 14000ft.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement