Advertisement
Guest User

Untitled

a guest
May 25th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class lab1 {
  5. public static void main(String[] args)
  6. {
  7. PrintMyName print = new PrintMyName();
  8. Root roots = new Root();
  9. Square square = new Square();
  10. StudentGrade grade = new StudentGrade();
  11.  
  12. System.out.println("Enter the number from 1 to 4: ");
  13. Scanner in = new Scanner(System.in);
  14. int n = in.nextInt();
  15. if ((n >= 1) && (n <= 4))
  16. {
  17. if (n == 1)
  18. {
  19. System.out.println("Print My Name: ");
  20. print.Print();
  21. }
  22. if (n == 2)
  23. {
  24. System.out.print("Enter your grade: ");
  25. int num = in.nextInt();
  26. grade.Grade(num);
  27. }
  28. if (n == 3)
  29. {
  30. System.out.println("Enter the length of the side of the square: ");
  31. double length = in.nextDouble();
  32. square.ArPrDg(length);
  33. }
  34. if (n == 4)
  35. {
  36. System.out.print("Enter a, b, c: ");
  37. int a = in.nextInt();
  38. int b = in.nextInt();
  39. int c = in.nextInt();
  40. roots.Find(a, b, c);
  41. }
  42. }
  43. in.close();
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement