Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void testGarethApp() {
- int runAmount = 5;
- // Scan user input
- Scanner sc = new Scanner(System.in);
- int totalValue= 0;
- for(int i = 0; i < runAmount; i ++)
- {
- System.out.println("please enter a number: ");
- // Add input value to total value
- totalValue += sc.nextInt();
- System.out.println("New Total Value: " + totalValue);
- }
- System.out.println("Average of total rounded down the river: " + totalValue / runAmount);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement