The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 365 Weeks Ago, 1 Day Ago |
| Questions Answered: | 1850 |
| Tutorials Posted: | 1850 |
Graduate in Biology and Nutrition, MBA Finance
Florida State University
Aug-2000 - Jul-2007
Ass. Relationship Manager
Penn-Florida
Mar-2009 - Feb-2016
Having a hard time figuring this out. Can anyone help me?
// Program Id: StatsArrayTester.cpp SKELETON CODE
// Written By: Â Patricia Baker and Super Smart Student <---------- HAHAHA that's not me (Tyler McKinley)
// Date:Â
// Description:
// This program uses a StatsArray class to exam grades and reports statistics
Â
#include <iostream>
#include <iomanip>
#include "StatsArray.h" Â Â //StatsArray class declaration and implementation
Â
using namespace std;
Â
//function prototypes
bool tryAgain();
Â
Â
//*************************** tester program *****************************
Â
int main()
{
  StatsArray examData;    // Create an instance of the StatsArray class
               // to manage exam dataÂ
 do
 {
 //fill array with random exam scores
 examData.randomFill();
Â
 cout << "Exam Scores" << endl;
 cout << "-----------" << endl;
 //display array elements
 examData.display();
Â
 //display additional array statistics such as maximum, minimum, total, average...
 Â
 Â
Â
} while ( tryAgain() );
   Â
  return 0;
}
Â
//function implementation
bool tryAgain()
{
char again = 'Y';
bool flag = false;
cout << "\nDo you want to try again? Â (Y or N) ";
cin >> again;
Â
if (toupper(again) == 'Y')
flag = true;
Â
return flag;
Â
}
Â
  // Program Id: StatsArray.h  SKELETON CODE
// Written By: Â Super Smart Student!
// Date:
// Brief Description: Â
Â
#include <iostream>
#include <iomanip>
#include <cstdlib> Â Â // Needed to use rand() and srand()
#include <time.h> Â Â // Needed for time functions
using namespace std;
Â
const int SIZE = 10; Â // Number of elements in the array
Â
class StatsArrayÂ
{
Â
private:
  int data[SIZE];   // array holding SIZE int values
     Â
public:
  StatsArray();    // Constructor.  Initialize all elements of data[] to 0
 Â
  void  randomFill();
  int   getSize();
  void  display();
  int   getTotal();
  double getAvg();
  int   getLargest();
  int   getSmallest();
  int   countValues (int, int);
  bool  isNumberFound(int);
 Â
};
Â
//********************implement functions here*******************
Â
//constructor. Â fills data[] array with 0s
StatsArray :: StatsArray()
{ Â
  for (int i = 0; i < SIZE; i++)
     data[i] = 0;
}
Â
//fill data[] array with random numbers (double) in the range 0 -100
void StatsArray::randomFill()
{ Â
   //seed the random number generator
   srand(static_cast<unsigned int>(time( NULL )));
Â
  //Your code goes here to fill the array with randomÂ
  //numbers from 0 – 100. Use a for loop!Â
 Â
}
Â
int StatsArray::getSize()
{ return SIZE; Â }
Â
//display the contents of the array with the index in [ ] brackets
void StatsArray::display()
{
//your code goes hereÂ
  Â
Â
}
Â
int StatsArray::getTotal()
{
Â
Â
Â
}
Â
double StatsArray::getAvg()
{
Â
Â
Â
}
Â
int StatsArray::getLargest()
{
Â
Â
Â
}
Â
Â
int StatsArray::getSmallest()
{
Â
Â
}
Â
int StatsArray::countValues(int, int)
{
Â
Â
Â
}
Â
bool StatsArray::isNumberFound(int)
{
Â
Â
Â
}
// continue to implement the other functionsÂ
Â
Â
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m Â----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I