import java.util.Scanner;
public class Marks
{
public static void main(String[]args)
{
Scanner scanner=new Scanner(System.in);
int totalMarks=0;
int count=0;
String responce;
do
{
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter your name");
name=scanner.nextLine();
System.out.println("Please enter your marks");
int mark=scanner.nextInt();
System.out.println("Do you want to continue(Y/N)");
totalMarks=totalMarks+mark
}while(responce.equals("y"));
System.out.println("The average marks for " + count +" is "+ totalMarks/count);
}
}
Tuesday, May 12, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment