Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Mission numbe 1

By: a guest on Feb 26th, 2012  |  syntax: Java  |  size: 0.48 KB  |  views: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.util.Scanner;
  2.  
  3. public class Main
  4. {
  5.  
  6.     public static void main (String[] args)
  7.     {
  8.         Scanner in= new Scanner (System.in);
  9.         int  num, sum=0, avg;
  10.              for (int i= 0; i<=12 ; i++)
  11.              {
  12.                System.out.println("Please enter 12 grades");
  13.                num=in.nextInt();
  14.                sum= sum+num;
  15.              }
  16.              avg= sum/12;
  17.              System.out.println("The average of the grades is: "+avg);
  18.     }
  19. }