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: | 397 Weeks Ago, 5 Days 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