Lab8S09 - CSCI 101 Fundamentals of Computer Programming Lab...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI 101: Fundamentals of Computer Programming Lab 8: Using functions in C++ Programs 1) Copy files named Numbers.txt, no_data.txt, Function_LabA.cpp and Function_LabB.cpp from BB to your computer and transfer them to your UNIX account. 2) Convert the program (Function_labA.cpp) to include the following functions: A) void Print_Header(void); // To print the introduction to the program. B) void Read_Sum( double &Harm_Tot, double &Geo_Tot, int &count); This function 1. prompt the user for a file name opens the data file and 2. reads the numbers from the data file, 3. finds the sums forharmonic and geometric mean calculation, 4. and send these sums and number of items read from the file back to the calling program. C) double Calc_Means(double Harm_Tot, double Geo_Tot, int Counter, double &Harm_Avg); This function will recieve the harmonic and geometric sums and a counter calculates and sends back the 2 means using return for geometric mean and pass by reference for harmonic mean. D) void Print_Report(int Count, double Harm_mean, double Geo_Mean);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online