Cosc1436_Final.doc

advertisement
SPRING 2013: COSC 1436
FINAL EXAM (100 points)
1) Declare and initialize an array to store the 10 most common single character middle initials.
(5 points)
2) Write an integer array to hold 4 numbers. Initialize values and write a for loop to increment
each element of the array by 5. (5 points)
3) Declare a double array that reads 5 values from the console. Write code that adds 8.2 to the
fourth element of the array. (5 points)
4) Declare a string array having length 6. Use a ForEach loop to initialize each element of the
array to value ”COSC1436”. (5 points)
5) Write a program that produces a multiplication table. The first base value should be 2 and
the last base value should be 8. Display a column in the table beginning with the first base
value. The last column should be the last base value. Produce 15 rows of computations. The
first row should be for 1 times the beginning base, 1 times the (beginning base value + 1),
through 1 times the ending base value. The last row should be for 15 times the beginning
base, 15 times the (beginning base value + 1), through 15 times the ending base value.
Display an aesthetically formatted multiplication table. (80 points)
Download