Number of Walks (BB), Strike Outs (SO), Hit by Pitch (HP), Sac Flys (SF), Singles, Doubles (2B), Triples (3B), and Home Runs (HR) as well as Number of At Bats (AB).
Based on this information, develop a set of functions within your program that will compute the following: Total Bases, Batting Average, Home Run Ratio, Strike Out Ratio, On Base Percentage, and Slugging Average.
You do not need to be a baseball fan to do this ... All the information you need in terms of the formulas and explanations can be found online.
Note: Number of hits is: singles + doubles + triples + home runs
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.#include <cstdlib>
using namespace std;
// Strikeout Ratio = Number of Strikeouts (divided by) Number of At Bats
double StrikeoutRatio(int strikeouts, int atBats);
// TotalBases = Number of (Singles + [2 x Doubles] +[ 3 x Triples] + [4 x Home Runs])
int TotalBases(int singles, int doubles, int triples, int homerun);
// Batting Average = Hits (divided by) At Bats
double BattingAverage(int hit, int atBats);\
// Home Run Ratio = Number of Home Runs Hit (divided by) Number of At Bats
double HomeRunRatio(int homeruns, int atBats);
// On Base Percentage = (Hits + Walks + Hit-By-Pitch) divided by (At Bats + Walks+ Hit-By-Pitch + Sac Flys)
double OnBasePercentage(int hits, int walks , int hitByPitch, int atBats, int sacFlys);
// Slugging Average =
double SluggingAverage(int singles, int doubles, int triples, int homerun, int atBats);...