Question: this is the code i have right now and the code isnt running how it should be , can anyone help me . Im at

this is the code i have right now and the code isnt running how it should be, can anyone help me. Im at a lost. I also need help with designing a flow chart diagram.
#include
#include
using namespace std;
int getGameDuration(){
int duration;
cout "Enter the game information as followed:
";
cout"Duration of the game in minutes (between 40 and 90, intervals of 10): ";
cin >> duration;
while (duration %10!=0|| duration 40|| duration >90)
{
cout "Your input for duration is Invalid! Please try again.
";
cout "Duration of the game in minutes (between 40 and 90, intervals of 10): ";
cin >> duration;
}
return duration;
}
double getPricePerMin(){
double pricePerMin;
cout "
";
cout "Price per minute (between $1.50 and $5.00): $";
cin >> pricePerMin;
while (pricePerMin 1.5|| pricePerMin >5.0)
{
cout "Your input for price is Invalid! Please try again.
";
cout "Price per minute (between $1.50 and $5.00): $";
cin >> pricePerMin;
}
return pricePerMin;
}
int calculateTotalPayment(int duration, double pricePerMin)
{
return duration * pricePerMin;
}
void calculateRefPayments(double totalPayment, double& centerRef, double& assistantRef)
{
int total_payment = getGameDuration()* getPricePerMin();
double centerref, assistantref;
total_payment =((int)total_payment);
int payment_to_divide = total_payment;
int remaining_payment =(payment_to_divide %10);
payment_to_divide =(payment_to_divide - remaining_payment);
centerref = payment_to_divide *0.4;
assistantref = payment_to_divide *0.3;
int shares_of_remaining = remaining_payment /3;
remaining_payment = remaining_payment %3;
centerref += shares_of_remaining;
assistantref += shares_of_remaining;
if (remaining_payment ==1)
{
centerref +=1;
}
else if (remaining_payment ==2)
{
assistantref +=1;
}
}
void printResults(int duration, double pricePerMin, double totalPayment, double centerRef, double assistantRef){
cout "
Referee Payment Breakdown:
";
cout "Game duration: " duration " minutes
";
cout "Price per minute: $" fixed setprecision(2) pricePerMin "
";
cout "Total payment: $" fixed setprecision(2) totalPayment "
";
cout "Center Referee's payment: $" fixed setprecision(2) centerRef "
";
cout "Assistant Referee's payment: $" fixed setprecision(2) assistantRef "
";
}
void refPaymentCalculation(){
char choice ='y';
while (choice =='y'|| choice =='Y')
{
int duration;
double pricePerMin;
getGameInformation(duration,pricePerMin);
double totalPayment = calculateTotalPayment(duration, pricePerMin);
double centerRef, assistantRef;
calculateRefPayments(totalPayment, centerRef, assistantRef);
printResults(duration, pricePerMin, totalPayment, centerRef, assistantRef);
cout "
";
cout "Do another calculation (y/n)?";
cin >> choice;
}
}
int main(){
refPaymentCalculation();
return 0;
}
this is the code i have right now and the code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!