-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIfElsedemo.java
More file actions
48 lines (40 loc) · 968 Bytes
/
IfElsedemo.java
File metadata and controls
48 lines (40 loc) · 968 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.util.Scanner;
class IfElsedemo
{
int rno;
String name;
double marks;
//IfElsedemo(int r,String n,double m)
//{
//r=rno;
//n=name;
//m=marks;
//rno=r;
//name=n;
//marks=m;
//}
void display()
{
Scanner userInputInt= new Scanner(System.in);
Scanner userInputString= new Scanner(System.in);
Scanner userInputDouble= new Scanner(System.in);
System.out.println("Enter Roll Number: ");
int rno=userInputInt.nextInt();
System.out.println("Enter Name: ");
String name=userInputString.nextLine();
System.out.println("Enter Marks: ");
double marks=userInputDouble.nextDouble();
System.out.println(" Rno : "+rno);
System.out.println(" Name : "+name);
System.out.println(" Marks : "+marks);
if (marks > 80)
System.out.println(" ==> Very Good ");
else
System.out.println(" ==> Not Good ");
}
public static void main(String args[])
{
IfElsedemo ig=new IfElsedemo();
ig.display();
}
}