Advertisement
glee20

Methods Test

Oct 8th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. import java.util.*;
  2. public class methodTest {
  3.      public static void main(String args[] ) {
  4.        int age;
  5.        String name;
  6.        int year;
  7.        double radius;
  8.        
  9.        methodsEg.welcome();
  10.        System.out.println("");
  11.        Scanner input = new Scanner(System.in);
  12.        System.out.println("Enter age: ");
  13.        age=input.nextInt();
  14.        
  15.        System.out.println("Age in 2020 is "+ methodsEg.ageIn2020(age));
  16.        System.out.println("");
  17.        
  18.        System.out.println("Enter target year: ");
  19.        year=input.nextInt();
  20.        System.out.println("Age in "+year+" will be "+ methodsEg.ageIn(age,year));
  21.        System.out.println("");
  22.        
  23.        System.out.println("Enter name: ");
  24.        name=input.next();
  25.        System.out.println("The first letter of your name is "+ methodsEg.firstLetter(name));
  26.        System.out.println("");
  27.        
  28.        System.out.println("Enter radius of circle: ");
  29.        radius=input.nextDouble();
  30.        System.out.println("The area of the circle is " + methodsEg.circleArea(radius));
  31.        System.out.println("");
  32.  
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement