- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoreOnScanner.java
More file actions
Latest commit
40 lines (36 loc) · 1.04 KB
/
Copy pathMoreOnScanner.java
File metadata and controls
40 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//imports.
importjava.util.Scanner;
classMoreOnScanner {
publicstaticvoidmain(String[] args) {
//instances..
Stringname;
intid;
intbatch;
StringDept;
doublecgpa;
//Scanner object - input..
Scannerinput = newScanner(System.in);
System.out.print("Enter Your Name: ");
name = input.next();
//taking char only..
System.out.print("Enter Your ID: ");
id = input.nextInt();
//taking Integer..
System.out.print("Enter Your Batch: ");
batch = input.nextInt();
//taking Integer..
System.out.print("Enter Your Department: ");
Dept = input.nextLine();
//taking tha hole String as line...
System.out.print("Enter Your CGPA: ");
cgpa = input.nextDouble();
//taking floating variable as Double..
//printing inputs..
System.out.println("You Entered- ");
System.out.println("Name: "+name);
System.out.println("ID: "+id);
System.out.println("Batch: "+batch);
System.out.println("DEpartment: "+department);
System.out.println("CGPA: "+cgpa);
}
}