without messing with the class, cause i cant modify it , i was wondering if there is a way to return thefunction calcscore as a float. I cant modify the class, where i call the function
"This contestants average score was..." it always just returns a .000 is there a way to pass it as a float without messin with the class?
//Jeremy Rice
// CSCI 111
// FALL 2007
#include <iomanip> // for setw(), setprecision()
#include "Stat.h"
#include <iostream>
using namespace std;
//Function Prototypes
void getJudgeData(int &);
double calcScore(Stat s);
const unsigned W=25; // argument for setw()
const unsigned P= 3; // argument for setprecision()
void showStat( Stat ); // displays statistics from Stat object
int main()
{
//Initilizing variables and class
Stat s;
int score1 = 0, score2 = 0, score3=0, score4=0, score5=0;
int x = 1;
double total = 0;
double winner = 0;
double contest;
char z;
cout << "This program assignment number #4"<<endl;
cout<< "THE NEXT AMERICAN IDOL"<<endl;
cout<< "By Jeremy Rice of CSCI 111"<<endl;
cout<<endl;
cout<< "Please enter your scores below!"<<endl;
//Ask each of the Judges for a score from 1-10
//anything less than 0 and greater than 10 will not be accepted
do
{
s.reset();
cout<< "Enter contestant #"<<x<< " scores!"<<endl;
cout<<setw(W)<<"\tJudge #1 what is your score [0...10] : ";
getJudgeData(score1); //calling function for score1
s.setNum(score1);
cout<<setw(W)<<"\tJudge #2 what is your score [0...10] : ";
getJudgeData(score2); //score2
s.setNum(score2);
cout<<setw(W)<<"\tJudge #3 what is your score [0...10] : ";
getJudgeData(score3); //score3
s.setNum(score3);
cout<<setw(W)<<"\tJudge …