This assignment will require you to develop a program that reads a series of positive and negative integers from the user and loads these values into an array. The program then calculates and outputs the average of the values read. You will develop the entire program from the problem statement, including developing the pseudo code, and the test data. There is no program template. You will be required to use the supplied function for loading the data. You must submit the program design/pseudo code for your program in advance of the program submission. The pseudo code is graded separately, and the instructor must approve your pseudo code/design before you can submit the c++ code.

Inputmod Function C++ code for a function named inputmod is in this conference. You must use this function with no changes. Bring the code into your project, including all comments, but do not change it in any way. You pass this function two parameters, an array of integers, and an integer value in which the function places a count of how many values were read. The function prompts the user to enter a value (negative values are valid and accepted) and continues prompting, reading and placing values in the array until an end-of-file mark is read.

End of File The last character in every file is a special character that marks the last character in the file to the operating system. It is a real character, and on a Windows/MS DOS machine it is CTRL Z. After you have entered the last value, at the next prompt enter CTRL Z and inputmod will return.

The Program Your program will read an unknown number of integers into an array, calculate the average, and produce a report with the average. Although the number of values to be averaged is not known, and may be different each time, assume that it is less than 100. You will need to write a function to calculate the average that has a float return value. Pass it the array and the number of values in the array, and return the average. Produce a report, either in main or with another function of the results of the calculation.

You must appropriately document your code, use appropriate indentation, and use self documenting variable names. Each module must have a set of header comments that lists the name of the person who created the code (i.e., you for the functions that you write, me for the functions that I wrote that you use), the date the code was created, a section listing revisions and revision dates (which will be empty in this the initial release of your program), a description of what the module does, what the module needs as inputs, the type of the inputs, and where they come from either the key board, or passed as parameters. Finally the header comments should describe the outputs from the module. Any known invalid cases or problems should also be described. Restrictions (like the limit of 100 values) should also be placed appropriately in the header.
You are responsible for creating a set of data to fully test your program, and to submit this with your assignment.

What You Need to Submit
There are two submissions for this project. You need to first design and write your program’s design, down to the fully detailed pseudo code. This is die before 11:59 PM November 20. 2010. Place the pseudo code in a Word (97-2003 format) file, and submit this through the assignment folder under the tab FinalDesign. Submission of C++ code instead of pseudo code for this part is not an acceptable submission. This will be graded and returned to you. In your pseudo code you do not have to give the pseudo code for inputmod, just show where it is used, what is passed to it, and what is returned. Functions that you write, however, will need the full complete pseudo code. The pseudo code must be appropriately indented, and issues of the appropriateness of variable names will be part of the grade. Your pseudo code will be reviewed and graded. Do not submit the c++ until after your pseudo code has been graded.

After the pseudo code is graded and approved, you will need to implement the pseudo code with a C++ program, compile it, and run it with a set of test data that fully tests your program. As with other assignments submitted in this class, submit a word file containing your source code, and print screens of your program runs. You will also need to submit a second Word (97-2003 format file) file with documentation about your program. It should contain a well-written document describing (1) Your overall design, including the approved pseudo-code; (2) Your test plan, including test data and results and what is being tested by each set of test data; (4) Your approach, design strengths, limitations and suggestions for future improvement and alternative approaches This part should not be about what aspects of the program’s development were difficult for you, or what you learned doing the project.

The Word file with the documentation describing and reflecting on your design and approach should be no more than 5 pages in length and no less than 2 pages. The font size should be 12 point. The page margins should be 1 inch. The paragraphs should be with double line spacing. All figures, tables, equations and referenced should be properly labeled and formatted using APA style.

Submit the two word files (one with your code and screen shots of the program running, and the other the documentation file) this under the tab FinalProg. [Grading Crietria:

Design and Pseudo Code  
    Structure   -  40 %
    Functionality   -  30%
    Style       -  30%
(indentation, variable names)

C++ Program 
    Comments,
    Indentation,
   And Style         -  30%
    Test Data       -  20%
    Compiles and 
   executes correctly, 
   and Fidelity to 
   Pseudo Code  -  20 %
Approach 
   Documentation    -  30%
                      100%

In addition to what's need here is inputmod;

void inputmod (int values [], int &count)
/***************************************************************************
*                                                                          *
*  inputmod                                                                *
*                                                                          *
*   a general utility routine for prompting a user to enter numbers   *
*   into an array.  The user indicates that all valuews have been     *
*   by entering an EOF (end of file) which is CTRL Z on an MS-DOS     *
*   operating system.  After the user enters CTRL Z the routine       *
*   the data entered using outputmod                                  *
*                                                                          *
*   parameters                                                             *
*   values  an integer array which is filled and returned            *
*   count   a reference parameter that upon return contains          *
*       the number of values read                                *
*                                                                          *
*Author:        T.Douglas                                                *
*   Initial Release:    11/18/2010                                      *
*                                                                          *
*   Revisions:                                                             *
*                                                                          *
***************************************************************************/


{
    count = 0;
    do
        cout << endl <<"Enter value " << count <<
            endl << "CTRL Z to stop" << endl << ">> " ;
    while (cin >> values [count++]);
    count--;

}

Recommended Answers

All 5 Replies

You are asking us to make en entire program for you?
Forget it ;)

If you have your entire code, but with a problem, feel free to ask me, i'll help you!
However, first give some effort, and TRY!

Good luck!

You are asking us to make en entire program for you?
Forget it ;)

If you have your entire code, but with a problem, feel free to ask me, i'll help you!
However, first give some effort, and TRY!

Good luck!

I am very new at this. I am looking for a tutor as we speak.

OK, I understand, but that's still not a reason to ask for an antire program.
Maybe write some code first, and then ask us anything on this forum...

Can someone help? I am attaching my pseudo code to the above post. I need help, suggestions, anything. I am new at this too and it isn't great but it is a start.

“Array, Average, Final project –pseudo code”

void inputmod (int values [], int &count)
void averagemod (float i, float nSum, int nNumber, float count)
printf outputmod (

declare nValues as constant 25

Main module
declare values [nValues] as integer
declare count as integer
count = 0
while count <= 25
call input module
end while
while count <=25
call average module
end while
while count >=25
call output module
end while
End main module

Input module (integer values [], integer count as ref)
* a general utility routine for prompting a user to enter numbers *
* into an array. The user indicates that all valuews have been *
* by entering an EOF (end of file) which is CTRL Z on an MS-DOS *
* operating system. After the user enters CTRL Z the routine *
* the data entered using outputmod *
* *
* parameters *
* values an integer array which is filled and returned *
* count a reference parameter that upon return contains *
* the number of values read *
* *

set count = 0
do
write "Enter value " count
"CTRL Z to stop" ">> "
while
input values [count++]
count--;
End input module

Average Module (count, values, averages as ref)
* calculationmod *
* *
* a general utility routine for calculating the average *
* user input into an array. *
* *
* parameters *
* values an integer array which is filled and returned *
* count a reference parameter that upon return contains *
* the number of values read *
* *

declare sum, i as float
for (i=0, i<=count, i++)
set sum += values+ values
set average = sum/count
write "This program averages a set of numbers\n”
“Enter number to average\n”
“Enter CTRL Z to terminate input”
end for
End Average Module

Output module (count, values, average)
* outputmod *
* *
* a general utility routine for outputing the average *
* user input into an array. *
* *
* parameters *
* values an integer array which is filled and returned *
* count a reference parameter that upon return contains *
* the number of values read *

write “Input terminated.”
write “Input data:”
displayArray (values, count)
write “The average is “ average
End Output Module

The only question you asked is "can someone help?"

Maybe you need to ask different questions...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.