course.wilkes.edu/CS125Labs
Welcome to the site for CS 125 labs!

 

DoubleVectorOps.cpp

Prev | Next | Lab 9

// DoubleVectorOps.cpp defines common operations for vector<double>.
//
// Begun by: Joel Adams, for Hands On C++.
// Completed by:
// Date:
//*******************************************************************

#include <iostream> #include <vector>

#include "DoubleVectorOps.h"

using namespace std;

//********************************************************** // ostream output * // Receive: out, an ostream containing a list of values, * // vec, the vector<double> to be displayed. * // PRE: vec.size() == the number of values in out. * // Passback: out, with a list of values extracted from it, * // vec, containing those values. * // Return: out, for chaining. * //********************************************************** ostream & operator<<(ostream & out, const vector<double> & vec) { for (int i = 0; i < int(vec.size()); i++) out << vec[i] << ' ';

return out; }

//**************************************** // Compute the mean of a list of numbers.* // Receive: theVec, the list of numbers. * // PRE: theVec.size() > 0. * // Return: the mean value. * //**************************************** // replace this line with a definition of Average()

//*************************************************** // Compute standard deviation of a list of numbers. * // Receive: theVec, the list of numbers. * // PRE: theVec.size() > 0. * // Return: the standard deviation of the list. * //*************************************************** // replace this line with a definition of StandardDev()

Prev | Next | Lab 9

 
  Home

Help

Lab 0

Lab 1

Lab 2

Lab 3a

Lab 3b

Lab 4

Lab 5

Lab 6

Lab 7

Lab 8

Lab 9

Lab 10

Lab 11

Lab 12

Lab 13



Membership

Login




Last update: Tuesday, November 13, 2001 at 1:05:50 PM.
visitors to this page.