Write a program in java to calculate a result of student by the univercity for five subject coundition is
if marks is >=75 first division,
if 65 to74 then second division,
if 55 to 64 then third division,
if 45 to 54 then fail.some other condition is if student fail in one subject then reapear,
2 fail then fail.
1
Expert's answer
2011-07-29T14:18:37-0400
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"); } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment