Posted By

DrPepper on 08/31/11


Tagged


Versions (?)

sample OOP


 / Published in: C++
 

  1. int main()
  2. {
  3. statistician s = new statistician ();
  4.  
  5. // Find the stats for 3 test scores
  6. // 92.4
  7. // 87.5
  8. // 88.3
  9.  
  10. // Add the data to the object
  11. s.next(92.4);
  12. s.next(87.5);
  13. s.next(88.3);
  14.  
  15. cout << "Average: " << s.mean() << "\n";
  16. cout << "Max: " << s.maximum() << "\n";
  17. }

Report this snippet  

You need to login to post a comment.