Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 In an object-oriented programming language of your choice, create a class named SportsTeam. This class must hold anywhere between 5 and 10 (inclusive) Players.
1 In an object-oriented programming language of your choice, create a class named SportsTeam. This class must hold anywhere between 5 and 10 (inclusive) Players. Each Player must hold a performance metric ranging from 0.0 to 10.0 (inclusive). The Sports Team class must have a method named getTeamPerformance which returns the average performance metric of all players on the team. A reference implementation in Python is provided. Use this if you would like to work with Python classSports Team definit_(self): self players 0 def addPlayer(self, plr): self players append(pin) def getTeamPerformance(self): if len(self players) notin return None total_perf=0.0 for p in self players: if p performance c o rp performance>100: return None total perfp performance return float(total_pert/float(len(self players)) classPlayer: definit (self, perf): self performance perf 2 In this tutorial, we have discussed code coverage. Write a test case for the Sports Teamclass and execute it under a code coverage tool (such as Coverage.pyl to show that complete code coverage is achieved, is this code coverage sufficient to conclude that the code is well-tested? is complete poth coverage achieved? Discuss and provide test case examples which test all paths in the Sports Teamclass
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started