-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDay07_prob2.java
More file actions
75 lines (58 loc) · 1.44 KB
/
Day07_prob2.java
File metadata and controls
75 lines (58 loc) · 1.44 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
A student will not be allowed to sit in exam if his/her attendence is less than 75%. Take following input from user
Number of classes held
Number of classes attended.
And print
percentage of class attended
Is student is allowed to sit in exam or not.
Input Format
Number of classes held
Number of classes attended.
Constraints
Number of classes held >= Number of classes attended.
and both must be Positive integer
Output Format
percentage of class attended
Is student is allowed to sit in exam or not.
Sample Input 0
100
80
Sample Output 0
80
Yes
Explanation 0
Number of classes held : 100
Number of classes attended : 80
And Output
percentage of class attended : 80
Is student is allowed to sit in exam or not : Yes
Sample Input 1
50
34
Sample Output 1
68
No
Explanation 1
Number of classes held : 50
Number of classes attended : 34
And Output
percentage of class attended : 68
Is student is allowed to sit in exam or not : No
*/
// kirtan jain
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
int a = sc.nextInt(), b = sc.nextInt();
int c = b*100/a;
System.out.println((int)c);
if(c>=75){
System.out.println("Yes");
}else{
System.out.println("No");
}
}
}