Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public static void testGarethApp() {
  2. int runAmount = 5;
  3. // Scan user input
  4. Scanner sc = new Scanner(System.in);
  5. int totalValue= 0;
  6. for(int i = 0; i < runAmount; i ++)
  7. {
  8.  
  9. System.out.println("please enter a number: ");
  10. // Add input value to total value
  11. totalValue += sc.nextInt();
  12. System.out.println("New Total Value: " + totalValue);
  13.  
  14. }
  15. System.out.println("Average of total rounded down the river: " + totalValue / runAmount);
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement