0
Help me, I cannot continue the lesson in C# Intermediate.
In the "Operator Overloading" lesson, I was given a code coach where I had to overload the operator to calculate the score for each team. When I compile, it works, but the result is wrong. And I can't see the test case because it's hidden. Here's my code: https://sololearn.com/compiler-playground/c3063MSPyl8s/?ref=app
3 Answers
+ 1
Here's the task:
You and your friend are playing a game as one team. Each player must pass 2 rounds and gets points for each round passed.
The program you are given creates two Score objects where each round scores are stored (they are passed to a constructor).
Overload the + operator for the Score class to calculate the team score for every round.
0
It looks to me like you're adding each player's round scores, i.e., player 1 round 1 + player 1 round 2. Is that the task? Or is to add both player's round together, i.e., player 1 round 1 + player 2 round 1?
0
Thanks for that.
So it should be the second equation I wrote, not the one you've calculated.