-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathps4_q1.java
More file actions
25 lines (23 loc) · 746 Bytes
/
Copy pathps4_q1.java
File metadata and controls
25 lines (23 loc) · 746 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
package com.barneel;
import java.util.Scanner;
//decision on whether student passes with 33 % in each subject and 40% overall.
public class ps4_q1
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
float per1, per2, per3;
System.out.println("enter the percentage marks one by one");
per1 = sc.nextFloat();
per2 = sc.nextFloat();
per3 = sc.nextFloat();
float totalp = (float) ((per1 + per2 + per3) / 3.0);
if (per1 >= 33 && per2 >= 33 && per3 >= 33 && totalp >= 40)
{
System.out.println("the student has passed:)");
}
else
{
System.out.println("You have failed my dear>)");
}
}
}