# COSC315 Extra Credit¶

It is late in the term, and I suspect a few of you are feeling like you could use a few more points in this course. Luckily, Santa stopped by and suggested an extra credit exercise. This should not be too bad, and can gain back a few of the points you might have lost somewhere during the term.

This project has two parts, each worth 25 points extra. You do not need to do either of these and you can do only one if you choose. They will be due on Sunday, May 19 at Midnight, along with all other work you wish to submit for credit.

## A Programming Exercise¶

Even though the final exam was a programming exercise, I am going to ask you to do one more. This one will be graded on several levels.

1. It has to work properly
2. The style has to be good. Indents where they belong and consistent use of brackets.
3. Variable names need to make sense. No A,B, X, Y allowed.
4. Be consistent in your use of spaces in your code. Look at examples in the text.

### The Problem¶

1. Set up a single array named “data” which will hold floating point numbers. The array should hold 10 items, and not be initialized

2. Have the main function in your program say hello in this way:

Data Processor (v0.1)

Date: Submission Date

3. Next prompt the user to enter exactly 10 floating point numbers. Then, set up a WHILE Loop that uses an integer counter variable to track how many times you spin around in the loop.

You should enter this list of test numbers:

• 12, 23, 34, 35, 56, 67, 78, 89, 910 1011
1. Create a function named “display” that will output your data, it will look like this:
void display( float d[], int size) {
...
}

1. Have the display function print out the input numbers, one per line. Each line should display a number, a colon, a single space, then the number.

• 1: 12
• 2: 23

You need to use a FOR loop to print this data out.

In the final output, there must be exactly one blank line separating this list from any other output, before or after.

2. Call this routine from your main code after getting the user data. The call will look like this:

display(data, 10);

3. Now set up a second FOR loop in main that accesses each number a second time. For each number, use your cube root routine to calculate the cube root of the number. Place that number back in the data array, replacing the original number

Note

If you did not get your cube root code to work, you may substitute a standard version from the C++ math library. (Look that up). There will be a penalty of five points if you do that.

4. Call your display function again, to show the processed data array. Again, there must be one blank line before and after this list.

5. Now set up a third FOR loop that adds up all the cube root values produced in the last step. Print out that final answer:

• Processed data result: xxxx
1. Print out an exit message:

• “Processing done!”

Submit the final C++ program on Blackboard. ALso submit the output of your program using the test data provided.

## Programming History¶

There is the idea floating around that men are better at computing and programming than women. Bull Pucky! For this part of the exercise, I want to you to research the following women who are notable for their contributions to the history of computing: