67 011
Assignments Done
99,4%
Successfully Done
In November 2018

Answer to Question #3750 in Action Script | Flash | Flex | ColdFusion for purnima

Question #3750
Write a program in java to calculate a result of student by the univercity for five subject coundition is <br>if marks is >=75 first division,<br>if 65 to74 then second division,<br>if 55 to 64 then third division,<br>if 45 to 54 then fail.some other condition is if student fail in one subject then reapear, <br>2 fail then fail.
Expert's answer
import java.util.*;public class Mark {
public static boolean division(int mark) {
if (mark >= 75)
System.out.println("first division");
else if (mark >= 65)
System.out.println("second division");
else if (mark >= 55)
System.out.println("third division");
else {
System.out.println("fail");
return true;
}
return false;
}

public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int mark;
int fail = 0;
for (int i = 0; i < 5; i++) {
mark = scan.nextInt();
System.out.print((i + 1) + " subject : ");
if (division(mark))
fail++;
}
if (fail == 1) {
System.out.println("Repear subject in which you have a fail");
mark = scan.nextInt();
if (division(mark))
System.out.println("Fail");
else
System.out.println("Not fail");
} else if (fail > 1)
System.out.println("Fail");
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions