Documentation ¶
Overview ¶
Declare a struct that represents a baseball player. Include name, atBats and hits. Declare a method that calculates a player's batting average. The formula is hits / atBats. Declare a slice of this type and initialize the slice with several players. Iterate over the slice displaying the players name and batting average.
Click to show internal directories.
Click to hide internal directories.