-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathmovieMagic.java
More file actions
57 lines (50 loc) · 1.16 KB
/
movieMagic.java
File metadata and controls
57 lines (50 loc) · 1.16 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.io.*;
class movieMagic
{
int year;
String title;
float rating;
public movieMagic()
{
year=0;
title=" ";
rating=0.0F;
}
public void accept(String args[])throws IOException
{
InputStreamReader in = new InputStreamReader(System.in);
BufferedReader y = new BufferedReader(in);
System.out.println("Input year");
year=Integer.parseInt(y.readLine());
System.out.println("Input title");
title=y.readLine();
System.out.println("Input rating");
rating=Float.parseFloat(y.readLine());
}
public void display()
{
if(rating<2.0)
{
System.out.println("FLOP");
}
if ((rating>2.0)&&(rating<3.5))
{
System.out.println("SEMI-HIT");
}
if ((rating>3.5)&&(rating<4.5));
{
System.out.println("HIT");
}
if((rating<4.5)&&(rating>5.0))
{
System.out.println("SUPER HIT");
}
System.out.println(title);
System.out.println(rating);
}
public static void main(String args[])throws IOException
{
movieMagic obj= new movieMagic();
obj.display();
}
}