CS 630 - Computing Fundamentals I - Summer 2004
Homework 4


Loyola College > Department of Computer Science > CS 630 > Homework > Homework 4

Due

Wednesday, June 30th at the beginning of class
Email programs (.cpp files) to lawrie@cs.loyola.edu

Problems

Problem 1: 4.6 a-d

Problem 2: 4.8

Problem 3: 4.9 a, c, d, e, i

Problem 4: 4.18

Problem 5: 4.19 (Programming)

Problem 6: 4.37 (Programming) Write a main that prompts the user for a string and then calls stringReverse to print the string backwards.

Problem 7: Write a program that declares an array of doubles called numbers that is size 20x20. Assign values to the array in the following manner:

where r is the row number and c is the column number. Recall that the rows and columns are numbered beginning with 0.
a) Compute the product of all the entries on the main diagonal and ouput the value.
b) Calculate the product of all the entries on the skew diagonal and output the value. (The skew diagonal is the one from the lower left corner to the upper right corner.)
c) Declare another array called copy to hold the lower right quarter of numbers and copy those numbers into copy. Output a formatted version of the array copy.