in a school, there are 4 different sections. in each section there are students who have appeared for icse examinations.write a program to input percentage marks of each student of each section. calculate and display the number of students of each section, securing 95% and above in the council examination.
Answers
Answer:import java.util.Scanner;
public class KboatExamResult
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int ta = 0, te = 0, tm = 0, ts = 0;
for (int i = 1; i <= 40; i++) {
System.out.println("Enter marks of student " + i);
System.out.print("English: ");
int eng = in.nextInt();
System.out.print("Maths: ");
int maths = in.nextInt();
System.out.print("Science: ");
int sci = in.nextInt();
if (eng >= 95 && maths >= 95 && sci >= 95)
ta++;
if (eng >= 90)
te++;
if (maths >= 90)
tm++;
if (sci >= 90)
ts++;
}
System.out.println("No. of students >= 95% in all subjects: " + ta);
System.out.println("No. of students >= 90% in English: " + te);
System.out.println("No. of students >= 90% in Maths: " + tm);
System.out.println("No. of students >= 90% in Science: " + ts);
}
}
Explanation:
Answer:
import java. util.Scanner;
public class KboatExamResult
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int ta = 0, te = 0, tm = 0, ts = 0;
for (int i = 1; i <= 40; i++) {
System.out.println("Enter marks of student " + i);
System.out.print("English: ");
int eng = in.nextInt();
System.out.print("Maths: ");
int maths = in.nextInt();
System.out.print("Science: ");
int sci = in.nextInt();
if (eng >= 95 && maths >= 95 && sci >= 95)
ta++;
if (eng >= 90)
te++;
if (maths >= 90)
tm++;
if (sci >= 90)
ts++;
}
System.out.println("No. of students >= 95% in all subjects: " + ta);
System.out.println("No. of students >= 90% in English: " + te);
System.out.println("No. of students >= 90% in Maths: " + tm);
System.out.println("No. of students >= 90% in Science: " + ts);
}
}
learn more
https://brainly.in/question/27873905
https://brainly.in/question/33426761
#SPJ2