CS 210 –
Fundamentals of Programming I
Spring 2007 – Homework 6
10
points
Out: April 23/24
Due: April 30/May 1
(at the beginning of class, no late work accepted)
Write C++ statements to do the following:
Declare string pointer variables named strPtr1 and strPtr2.
Allocate an anonymous string variable, and make strPtr1 point to it.
Input a string value from the keyboard and store it in the anonymous variable of Problem 2.
Display the value of the anonymous variable of Problem 2.
Cause strPtr2 to point to the anonymous variable of Problem 2.
Declare a double pointer variable named doublePtr.
Allow the user to enter n, the number of values to be processed; then allocate an anonymous array of n double values, and make doublePtr point to it.
Fill the anonymous array of Problem 7 with n input values, entered from the keyboard.
Compute and display the average of the values in the anonymous array of Problem 7.
Deallocate the storage of the anonymous variable of Problem 2 and the anonymous array of Problem 7.
04/20/07