Computer Science, asked by starsam, 9 months ago

Write a program to input student name, class, roll number and marks in five subjects. Calculate the total marks and percentage.

PLEASE give the answer fast... ​

Answers

Answered by Anonymous
21

import java.util.Scanner;

class name

{

public static void main(String[] args)  

{

 Scanner sc=new Scanner(System.in);

{

System.out.println("enter your name");

String n = sc.nextLine();

System.out.println("enter class " );

int c = sc.nextInt();

System.out.println("enter roll no.")

int r = sc.nextInt();

 System.out.print(" Please Enter the Five Subjects Marks : ");

 int english= sc.nextInt();  

 int chemistry = sc.nextInt();  

 int computers = sc.nextInt();  

 int physics = sc.nextInt();  

 int hindi = sc.nextInt();  

 int total = english + chemistry + computers + physics + maths;

 double Average = total / 5;

   double Percentage = (total / 500) * 100;

       System.out.println(n);

             System.out.println(c);

               System.out.println(r);

    System.out.println(" Total Marks =  " + total);

    System.out.println(" Average Marks =  " + Average);

    System.out.println(" Marks Percentage =  " + Percentage);

              }

}

}

Answered by aartimanoj17285
8

Answer:

import java.util.Scanner;

class name

{

public static void main(String[] args)

{

Scanner sc=new Scanner(System.in);

{

System.out.println("enter your name");

String n = sc.nextLine();

System.out.println("enter class " );

int c = sc.nextInt();

System.out.println("enter roll no.")

int r = sc.nextInt();

System.out.print(" Please Enter the Five Subjects Marks : ");

int english= sc.nextInt();

int chemistry = sc.nextInt();

int computers = sc.nextInt();

int physics = sc.nextInt();

int hindi = sc.nextInt();

int total = english + chemistry + computers + physics + maths;

double Average = total / 5;

double Percentage = (total / 500) * 100;

System.out.println(n);

System.out.println(c);

System.out.println(r);

System.out.println(" Total Marks = " + total);

System.out.println(" Average Marks = " + Average);

System.out.println(" Marks Percentage = " + Percentage);

}

}

}

Explanation:

please mark my answer as the brainliest

Similar questions