// HEADER file for gfun1.cpp // FILENAME: gfun1.h // PROGRAMMER: Dr.Iz (Urieli) 9/10/03 using namespace std; float const PI = 3.141593; class Pendulum{ private: float length; // [m] pendulum length public: float g_base; // [m/s^2] baseline value of g Pendulum(float x = 1.0) { // Constructor for Pendulum g_base = 9.807; // [m/s^2] length = x; cout << "pendulum length set at " << length << "[m]\n"; cout << "for baseline gravity of " << g_base << "[m/s^2]\n"; cout << "small angle period is " << 2*PI*sqrt(length/g_base) << "[s]\n"; } float find_g(float period); // function to determine local acceleration due to gravity g // based on a pendulum experiment // pre: argument "period" and pendulum "length" have values // post: value of g has been evaluated and returned. }; //################################################################