/* * 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)); } }
Comments