Calculate the total and percent with 100 as full marks of 3 subjects. If %is greater than 60display "you are eligible" as "not" | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grátis
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???

1st Feb 2022, 7:24 AM
ANU
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.
1st Feb 2022, 8:50 AM
A͢J
A͢J - avatar
+ 1
Ok thanks a lottt
1st Feb 2022, 9:14 AM
ANU