-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIOprogram.java
More file actions
24 lines (22 loc) · 785 Bytes
/
Copy pathIOprogram.java
File metadata and controls
24 lines (22 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.*;
public class IOprogram
{
public static void main(String[] args)
{
String name;
int birthYear;
float weight;
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter your name : ");
name=scanner.nextLine();
System.out.println("Please enter your birth of year : ");
birthYear=scanner.nextInt();
System.out.println("Please enter your weight : ");
weight=scanner.nextFloat();
System.out.println("Your name : " +name);
int age =2021 - birthYear;
System.out.println("Your age : " +age);
System.out.println("Your weight : " +weight);
scanner.close();
}
}