define the Team class (in files Team.h and Team.cpp). For class member function GetWinPercentage(), the formula is: teamWins / (teamWins + teamLosses) Note: Use casting to prevent integer division. Ex: If the input is: Ravens 13 3 where Ravens is the team's name, 13 is number of team wins, and 3 is the number of team losses, the output is: Congratulations, Team Ravens has a winning average! If the input is Angels 80 82, the output is: Team Angels has a losing average.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
7.23 LAB: Winning team (classes)
Given main(), define the Team class (in files Team.h and Team.cpp). For class member function GetWinPercentage(), the formula is:
teamWins / (teamWins + teamLosses)
Note: Use casting to prevent integer division.
Ex: If the input is:
Ravens 13 3where Ravens is the team's name, 13 is number of team wins, and 3 is the number of team losses, the output is:
Congratulations, Team Ravens has a winning average!If the input is Angels 80 82, the output is:
Team Angels has a losing average.


Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images









