Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class lab1 {
- public static void main(String[] args)
- {
- PrintMyName print = new PrintMyName();
- Root roots = new Root();
- Square square = new Square();
- StudentGrade grade = new StudentGrade();
- System.out.println("Enter the number from 1 to 4: ");
- Scanner in = new Scanner(System.in);
- int n = in.nextInt();
- if ((n >= 1) && (n <= 4))
- {
- if (n == 1)
- {
- System.out.println("Print My Name: ");
- print.Print();
- }
- if (n == 2)
- {
- System.out.print("Enter your grade: ");
- int num = in.nextInt();
- grade.Grade(num);
- }
- if (n == 3)
- {
- System.out.println("Enter the length of the side of the square: ");
- double length = in.nextDouble();
- square.ArPrDg(length);
- }
- if (n == 4)
- {
- System.out.print("Enter a, b, c: ");
- int a = in.nextInt();
- int b = in.nextInt();
- int c = in.nextInt();
- roots.Find(a, b, c);
- }
- }
- in.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement