Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Lab3_Task2 {
  3.  
  4. public static void main(String[] args) {
  5. //Konstruerar en ny scanner
  6. Scanner inp = new Scanner(System.in);
  7.  
  8. //Skapar två objekt av typen Airplane
  9. Lab3_Airplane plane1 = new Lab3_Airplane(12000, 3, 400, "Boeing 777");
  10. Lab3_Airplane plane2 = new Lab3_Airplane(14000, 2, 500, "Airbus A380");
  11.  
  12. //Skriver ut all data
  13. System.out.println("Airplane model: " + plane1.getModel());
  14. System.out.println("Current speed: " + plane1.getSpeed());
  15. System.out.println("Current direction: " + plane1.getDirection());
  16. System.out.println("Current attitude: " + plane1.getHeight() + "ft.\n");
  17.  
  18. System.out.println("Airplane model: " + plane2.getModel());
  19. System.out.println("Current speed: " + plane2.getSpeed());
  20. System.out.println("Current direction: " + plane2.getDirection());
  21. System.out.println("Current attitude: " + plane2.getHeight() + "ft.");
  22. }
  23.  
  24. }
  25.  
  26.  
  27. Airplane model: Airbus A380
  28. Current speed: 500
  29. Current direction: South
  30. Current attitude: 14000ft.
  31.  
  32. Airplane model: Airbus A380
  33. Current speed: 500
  34. Current direction: South
  35. Current attitude: 14000ft.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement