Need help solving C++ comparing total run of two teams using 2 classes player and team [closed]Yahtzee game...

In Japanese, what’s the difference between “Tonari ni” (となりに) and “Tsugi” (つぎ)? When would you use one over the other?

What does it mean to describe someone as a butt steak?

Why are electrically insulating heatsinks so rare? Is it just cost?

How is it possible to have an ability score that is less than 3?

Why do I get two different answers for this counting problem?

Either or Neither in sentence with another negative

Why don't electron-positron collisions release infinite energy?

Method of fabrication patents, Is it okay to import from abroad?

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

How to know the difference between two ciphertexts without key stream in stream ciphers

How much RAM could one put in a typical 80386 setup?

Mathematical cryptic clues

Why does Kotter return in Welcome Back Kotter?

How does strength of boric acid solution increase in presence of salicylic acid?

Why is Minecraft giving an OpenGL error?

1 as a common root of a quadratic equation

What typically incentivizes a professor to change jobs to a lower ranking university?

Have astronauts in space suits ever taken selfies? If so, how?

Arrow those variables!

Modeling an IP Address

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?

Why, historically, did Gödel think CH was false?

What is the word for reserving something for yourself before others do?



Need help solving C++ comparing total run of two teams using 2 classes player and team [closed]


Yahtzee game (using arrays and object classes)Multiplayer bowling in Ruby, with variable skillNode2D and Node3D classes implemented using a shared decoratorPrompting for two integers and dividing, using exceptions to handle divide-by-zero errorsCalculator for the area of various 3D figures, using abstract classes and inheritanceRead date from a file and rename two files using the dateProgram to run gas pumps, calculate amount pumped and total costsPython stack and queue classes, implemented using lists






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







-3












$begingroup$


The function void team who_win(team T) is not working. Can't figure out what's the problem. Need help. Thanks.




#include<iostream>
using namespace std;
class player {
private :
char name[50];
int jersey;
int run;
public :
player()
{
cout << "Player constructed"<<endl;
}
void input();
void display();
int P_run();
};
class team {
private :
char T_name[50];
player p[3];
int totalrun;
public :
team()
{
cout<<"Team constructed"<<endl;
}
void input();
void display();
void compute_run();
void who_win(team T); };


int main() {
team T1,T2;
T1.input();
T2.input();
T1.display();
T2.display();
T1.compute_run();
T2.compute_run();
T1.who_win(T2); }


int player::P_run() {
return run; }


void team::compute_run() {
int totalrun=0;
totalrun=p[0].P_run()+p[1].P_run()+p[2].P_run();
cout<<"Total run scored by "<<T_name<<" is "<<totalrun<<endl; }


void team::who_win(team T) {
if(totalrun>T.totalrun)
cout<<T_name<<" has won the game.";
else if(totalrun==T.totalrun)
cout<<"Match draw.";
else
cout<<T.T_name<<" has won the game."; }


//didn't copy & paste the other functions...











share|improve this question









$endgroup$



closed as off-topic by Toby Speight, Heslacher, BCdotWEB, Sᴀᴍ Onᴇᴌᴀ, 200_success Mar 29 at 15:58


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Toby Speight, Heslacher, BCdotWEB, Sᴀᴍ Onᴇᴌᴀ, 200_success

If this question can be reworded to fit the rules in the help center, please edit the question.
















  • $begingroup$
    Welcome to Code Review! I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our help center for more information.
    $endgroup$
    – Toby Speight
    Mar 29 at 12:22










  • $begingroup$
    We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review. Please follow the tour, and read "What topics can I ask about here?", "How do I ask a good question?" and "What types of questions should I avoid asking?".
    $endgroup$
    – BCdotWEB
    Mar 29 at 13:40


















-3












$begingroup$


The function void team who_win(team T) is not working. Can't figure out what's the problem. Need help. Thanks.




#include<iostream>
using namespace std;
class player {
private :
char name[50];
int jersey;
int run;
public :
player()
{
cout << "Player constructed"<<endl;
}
void input();
void display();
int P_run();
};
class team {
private :
char T_name[50];
player p[3];
int totalrun;
public :
team()
{
cout<<"Team constructed"<<endl;
}
void input();
void display();
void compute_run();
void who_win(team T); };


int main() {
team T1,T2;
T1.input();
T2.input();
T1.display();
T2.display();
T1.compute_run();
T2.compute_run();
T1.who_win(T2); }


int player::P_run() {
return run; }


void team::compute_run() {
int totalrun=0;
totalrun=p[0].P_run()+p[1].P_run()+p[2].P_run();
cout<<"Total run scored by "<<T_name<<" is "<<totalrun<<endl; }


void team::who_win(team T) {
if(totalrun>T.totalrun)
cout<<T_name<<" has won the game.";
else if(totalrun==T.totalrun)
cout<<"Match draw.";
else
cout<<T.T_name<<" has won the game."; }


//didn't copy & paste the other functions...











share|improve this question









$endgroup$



closed as off-topic by Toby Speight, Heslacher, BCdotWEB, Sᴀᴍ Onᴇᴌᴀ, 200_success Mar 29 at 15:58


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Toby Speight, Heslacher, BCdotWEB, Sᴀᴍ Onᴇᴌᴀ, 200_success

If this question can be reworded to fit the rules in the help center, please edit the question.
















  • $begingroup$
    Welcome to Code Review! I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our help center for more information.
    $endgroup$
    – Toby Speight
    Mar 29 at 12:22










  • $begingroup$
    We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review. Please follow the tour, and read "What topics can I ask about here?", "How do I ask a good question?" and "What types of questions should I avoid asking?".
    $endgroup$
    – BCdotWEB
    Mar 29 at 13:40














-3












-3








-3





$begingroup$


The function void team who_win(team T) is not working. Can't figure out what's the problem. Need help. Thanks.




#include<iostream>
using namespace std;
class player {
private :
char name[50];
int jersey;
int run;
public :
player()
{
cout << "Player constructed"<<endl;
}
void input();
void display();
int P_run();
};
class team {
private :
char T_name[50];
player p[3];
int totalrun;
public :
team()
{
cout<<"Team constructed"<<endl;
}
void input();
void display();
void compute_run();
void who_win(team T); };


int main() {
team T1,T2;
T1.input();
T2.input();
T1.display();
T2.display();
T1.compute_run();
T2.compute_run();
T1.who_win(T2); }


int player::P_run() {
return run; }


void team::compute_run() {
int totalrun=0;
totalrun=p[0].P_run()+p[1].P_run()+p[2].P_run();
cout<<"Total run scored by "<<T_name<<" is "<<totalrun<<endl; }


void team::who_win(team T) {
if(totalrun>T.totalrun)
cout<<T_name<<" has won the game.";
else if(totalrun==T.totalrun)
cout<<"Match draw.";
else
cout<<T.T_name<<" has won the game."; }


//didn't copy & paste the other functions...











share|improve this question









$endgroup$




The function void team who_win(team T) is not working. Can't figure out what's the problem. Need help. Thanks.




#include<iostream>
using namespace std;
class player {
private :
char name[50];
int jersey;
int run;
public :
player()
{
cout << "Player constructed"<<endl;
}
void input();
void display();
int P_run();
};
class team {
private :
char T_name[50];
player p[3];
int totalrun;
public :
team()
{
cout<<"Team constructed"<<endl;
}
void input();
void display();
void compute_run();
void who_win(team T); };


int main() {
team T1,T2;
T1.input();
T2.input();
T1.display();
T2.display();
T1.compute_run();
T2.compute_run();
T1.who_win(T2); }


int player::P_run() {
return run; }


void team::compute_run() {
int totalrun=0;
totalrun=p[0].P_run()+p[1].P_run()+p[2].P_run();
cout<<"Total run scored by "<<T_name<<" is "<<totalrun<<endl; }


void team::who_win(team T) {
if(totalrun>T.totalrun)
cout<<T_name<<" has won the game.";
else if(totalrun==T.totalrun)
cout<<"Match draw.";
else
cout<<T.T_name<<" has won the game."; }


//didn't copy & paste the other functions...








beginner






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 29 at 12:07









SekritcowSekritcow

1




1




closed as off-topic by Toby Speight, Heslacher, BCdotWEB, Sᴀᴍ Onᴇᴌᴀ, 200_success Mar 29 at 15:58


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Toby Speight, Heslacher, BCdotWEB, Sᴀᴍ Onᴇᴌᴀ, 200_success

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Toby Speight, Heslacher, BCdotWEB, Sᴀᴍ Onᴇᴌᴀ, 200_success Mar 29 at 15:58


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Toby Speight, Heslacher, BCdotWEB, Sᴀᴍ Onᴇᴌᴀ, 200_success

If this question can be reworded to fit the rules in the help center, please edit the question.












  • $begingroup$
    Welcome to Code Review! I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our help center for more information.
    $endgroup$
    – Toby Speight
    Mar 29 at 12:22










  • $begingroup$
    We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review. Please follow the tour, and read "What topics can I ask about here?", "How do I ask a good question?" and "What types of questions should I avoid asking?".
    $endgroup$
    – BCdotWEB
    Mar 29 at 13:40


















  • $begingroup$
    Welcome to Code Review! I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our help center for more information.
    $endgroup$
    – Toby Speight
    Mar 29 at 12:22










  • $begingroup$
    We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review. Please follow the tour, and read "What topics can I ask about here?", "How do I ask a good question?" and "What types of questions should I avoid asking?".
    $endgroup$
    – BCdotWEB
    Mar 29 at 13:40
















$begingroup$
Welcome to Code Review! I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our help center for more information.
$endgroup$
– Toby Speight
Mar 29 at 12:22




$begingroup$
Welcome to Code Review! I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our help center for more information.
$endgroup$
– Toby Speight
Mar 29 at 12:22












$begingroup$
We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review. Please follow the tour, and read "What topics can I ask about here?", "How do I ask a good question?" and "What types of questions should I avoid asking?".
$endgroup$
– BCdotWEB
Mar 29 at 13:40




$begingroup$
We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review. Please follow the tour, and read "What topics can I ask about here?", "How do I ask a good question?" and "What types of questions should I avoid asking?".
$endgroup$
– BCdotWEB
Mar 29 at 13:40










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Fairchild Swearingen Metro Inhaltsverzeichnis Geschichte | Innenausstattung | Nutzung | Zwischenfälle...

Pilgersdorf Inhaltsverzeichnis Geografie | Geschichte | Bevölkerungsentwicklung | Politik | Kultur...

Marineschifffahrtleitung Inhaltsverzeichnis Geschichte | Heutige Organisation der NATO | Nationale und...