For and While and Do loops Practice Problems


  1. Write a main method that will read in 10 integers, find the average, and display it.

  2. Write a main method that will read in 10 integers, find the largest of those values, and display it.

  3. Write a main method that will read in integers until a negative value is entered, and displays the sum of all of the non-negative value that had been entered.

  4. Write a main method that will as the user to enter a positive integer value n and will then add the integers from 1 to n and print that value.