0
Calculate the total and percent with 100 as full marks of 3 subjects. If %is greater than 60display "you are eligible" as "not"
import java.util.*; public class result{ public static void main(String args[]){ double sub1,sub2, sub3 ; Scanner kbd=new Scanner (System.in); System.out.println ("Enter marks obtained in sub 1="); sub1= kbd.nextDouble (); System.out.println ("Enter marks obtained in sub 2="); sub2= kbd.nextDouble (); System.out.println ("Enter marks obtained in sub 2="); sub3= kbd.nextDouble (); double t,p; t= sub1+sub2+sub3; System.out.println("The total is="+t); p= (t/300)*100; System.out.println("The percentage is="+p); if (p>=60) { System.out.println(" You are eligible to opt Science"); } else { System.out.println("You are not eligible to opt Science"); } } } IS IT CORRECT???
2 Respostas
+ 2
ANU
Yes program is right but if you are doing any task then don't print anything else except what they said to print.
+ 1
Ok thanks a lottt