wap to input marks of N students of a class.find the total marks and average marks of the class using While - wend
Answers
Answer:
import java.util.Scanner;
public class Percentage_calculator_of_tests
{
public static void main(String args[])
{
double physics,chemistry,math,biology,English_1,English_2,computer,hindi,history_civics ,geography,total,avg;
Scanner scan = new Scanner(System.in);
System.out.println("Enter physics marks");
physics=scan.nextDouble();
System.out.println("Enter chemistry marks");
chemistry=scan.nextDouble();
System.out.println("Enter math marks");
math=scan.nextDouble();
System.out.println("Enter biology marks");
biology=scan.nextDouble();
System.out.println("Enter English_1 marks");
English_1=scan.nextDouble();
System.out.println("Enter English_2 marks");
English_2=scan.nextDouble();
System.out.println("Enter computer marks");
computer=scan.nextDouble();
System.out.println("Enter hindi marks");
hindi=scan.nextDouble();
System.out.println("Enter history_civics marks");
history_civics=scan.nextDouble();
System.out.println("Enter geography marks");
geography=scan.nextDouble();
total=physics+chemistry+math+biology+English_1+English_2+computer+hindi+history_civics+geography;
avg=total/10.0;
System.out.println("Your percentage ="+avg);
}
}
Explanation:
This program is similar to your question