import java.util.Scanner;
class Test
{
public static void main(String[] args)
{
int totalMarks=0, mark=0, numStudent=0;
Scanner scanner = new Scanner(System.in);
System.out.println("Plrase enter the numbers of student in your class");
numStudent = scanner.nextInt();
for(int i = 0 ; i < numStudent ; i++)
{
System.out.print("Please enter your mark for student " +(i+1) +" :");
mark = scanner.nextInt();
totalMarks = totalMarks + mark;
}
System.out.println("\nAverage mark for " +numStudent + " student are "+ totalMarks/numStudent);
}
}
Sunday, May 10, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment