Answer to Question #43468 in Java | JSP | JSF for Sam Ananth

Question #43468
write a program to accept the name of a student and 10 subject marks of the student.calculate the total and the average.
Expert's answer
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.Scanner;
public class Student_app {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String name = "";
double total=0;
Scanner sc = new Scanner(System.in);
System.out.print("Name=");
name=sc.nextLine();
for (int i = 0; i < 10; i++) {
System.out.print((i+1)+"=");
total+=sc.nextInt();
}
System.out.println("Name= "+name);
System.out.println("total= "+total);
System.out.println("average= "+(double)(total/10));

}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal