Graderpractice for programmers

254271 Fun (2562 Sec 2) - Arrays

Awaiting submission
Use a for to print the following array of Strings.
String[] names = {"Anna", "Beryl", "Clara", "Desmond", "Eleanor", "Fiona", "George", "Henry"}
Awaiting submission
Add up all the ints in the array.
int[] numbers = {2, 6, 5, 5, 7}; 
Awaiting submission
Write a program that reads strings into an array. When the input ends (with a *), print all the strings on one line, separated by a space.
Awaiting submission
Write a program that reads in a list of strings (one per line) and prints them out in reverse order.
Awaiting submission
Read in a list of strings and print out the one in the middle (or the two in the middle).
Awaiting submission
Write a program that reads in integers and prints them in reverse order.

To read until the end:

while (sc.hasNext()) {
    int x = sc.nextInt();
    ...
}

To end the input, press Ctrl-Z.

Awaiting submission
Write a program that reads in a list of integers. Print out all the integers that are less than the last element of the list. Example, if the input is 3 8 5 7 then the last element is 7, so print out 3 5.
Awaiting submission
Write a program that reads in a list of integers and then prints out the numbers 1 to 20 NOT including the numbers from the input.