Free2Code
 
Time: 2008-11-21, 10:00pm
C++ Help
Subject: C++ Help  ·  Posted: 2006-12-05, 10:09am
Rank: ? (1)
Member #: 29324
I have an assignment due and i cant figure it out here is the program

4. Write a C++ program that asks the user to type in a file name. Use a c-string for this, i.e., a character array, like we did in class. Then open it for input.

Next, create a 100-element array of type double and read the file contents into your array.

Create a function that computes the average of the numbers, and the highest and lowest values of the array. Do all this in one pass through the array.

Create another function that computes the standard deviation of the array. If you don’t know the formula, google it or look in Wikipedia or go see the math tutor. You might need to include the cmath header file for this part.

From the main, tastefully display these 4 statistics and then close the file.

Save your program as “Chap7_Prog4.cpp�.


 
  Reply to this ·  Post link ·  Top
Subject: Re: C++ Help  ·  Posted: 2006-12-05, 12:29pm
Rank: ? (767)
Member #: 11085
Of that description, what exactly are you having trouble with? Would you show some code along with your question?

- relpats_eht
 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons