// Progress of the Championship as a percentage
Progress of the Championship as a percentage
// Progress of the Championship as a percentage
func (c *Championship) Progress() float64 {
	numRaces := float64(len(c.Events))
	if numRaces == 0 {
		return 0
	}
	numCompletedRaces := float64(0)
	for _, race := range c.Events {
		if race.Completed() {
			numCompletedRaces++
		}
	}
	return (numCompletedRaces / numRaces) * 100
}
func ( c * Championship ) Progress ( ) float64 { numRaces := float64 ( len ( c . Events ) ) if numRaces == 0 { return 0 } numCompletedRaces := float64 ( 0 ) for _ , race := range c . Events { if race . Completed ( ) { numCompletedRaces ++ } } return ( numCompletedRaces / numRaces ) * 100 }
Progress of the Championship as a percentage
Progress of the Championship as a percentage