# CS 102 Lab1

## Overview:

This is a simple review lab to help you shake the rust off of your programming skills. It is designed to help you review the material from cs101, particularly one dimensional arrays. It is intended to be short and non-threatening to get you used to the eagle server again. Because of this, the requirements are strictly specified.

## What you must do:

Take the following snippet of code and implement the three missing functions according to the specifications for each one below. You will write a program that will query the user to input integers one at a time up to MAX_ARRAY numbers. If the user ever enters a number that is zero or negative, then the program should stop querying for input at that point. When the program has gotten all its input, it should add the number up and then print a large addition problem with the sum of all the entered numbers at the end. You must use the main function provided below exactly as it is (just copy it off your web browser and into your program file)

----------------------begin code file---------------------------------
#include <iostream>
const int MAX_ARRAY=10;

int main (){
int Data[MAX_ARRAY];
Query_Input(Data);
int answer = Add_Array(Data);
Print_Answer(answer, Data);
}

-------------------end code file------------------------------------

### Query_Input Specifications:

Must be defined with a prototype sufficient to work with the main method. The function needs to query the user to input integers, one at a time until either MAX_ARRAY numbers have been input, or the user enters zero or a negative number.

### Add_Array Specifications:

must sum the data that the user entered into the array and return that sum as its return value.

### Print_Answer Specifications:

Must print out a message stating that the sum of each number in the array is equal to the sum generated by Add_Array. Each number in the array must be printed similar to the sample output printed below:

### Sample output:

eagle {~} >lab1
Please enter a number to sum, or negative to stop adding
1
Please enter a number to sum, or negative to stop adding
2
Please enter a number to sum, or negative to stop adding
3
Please enter a number to sum, or negative to stop adding
4
Please enter a number to sum, or negative to stop adding
5
Please enter a number to sum, or negative to stop adding
6
Please enter a number to sum, or negative to stop adding
-1
The sum of 1 + 2 + 3 + 4 + 5 + 6 + -1 + is 25.
eagle {~} >

## Due Date:

The project is due by Midnight Wednesday September 22nd.