Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program on c++ about this The University of Alabama (UA) kicks off the f

ID: 3871704 • Letter: W

Question

Write a program on c++ about this The University of Alabama (UA) kicks off the football season September 2nd against Florida State University (FSU). In this homework you will use some data to determine the probability that UA will beat FSU. You should assume that the basic probability of two football teams that play each other, with no other information, is 50/50 (50%). The output should be a single table row showing that statistics and the win probability. The statistic rules are as follows: 1. Alabama will be playing in the Mercedes-Benz Stadium in Atlanta. This should be considered a home game for Alabama. If Alabama is home, their win probability increases by 10%. Calculate this probability as a function called homeOrAway() that returns a float of either .1 or 0. 2. This is the first game of the season for both teams. Thus, their records are 0-0; however, if Alabama has won at least four games in a season and has no losses, then their win probability increases by 10%. Calculate this probability as a function called noLosses() that returns a float of either .1 or 0. 3. If the opposing team has played four games and has more than one loss, their win probability goes down by 10%. Calculate this probability as a function called opponentLosses() that returns a float of either -.1 or 0. 4. The team with the lowest (e.g. #1 is lowest rank) rank increases their win probability by 10%. Calculate this probability as a function called ranking() that returns a float of +.1 or -.1. Alabama is ranked #1, and FSU is ranked #9. 5. The team with the best total defense will increase their win probability by 10%. Calculate this probability as a function called totalDefense() that returns a float of +.1 or -.1. Alabama's total defense is ranked #2, and FSU is ranked #22. 5. The team with the best total offense will increase their win probability by 10%. Calculate this probability as a function called totalOffense() that returns a float of +.1 or -.1. Alabama's total defense is ranked #3, and FSU is ranked #25. After calculating all of these probabilities, output the results as follows: =H=Team Name=Records=Ranking=Next Opponent=Tot. Def.=Tot. Off.=Win Prob.= =Y=Alabama Crimson Tide=0-0 / 0-0=1-9=Florida State Seminoles=2 / 22=3 / 25= XX.X%=

Explanation / Answer

the program i know so far

#define MAXTEAMS 10
#define MAXGAMES 18
#include <stdio.h>
struct team
{
char name [15];
int pld;
int w;
int d;
int l;
int pts;
int games[MAXGAMES];
};
struct game
{
char hometeam [15];
char awayteam [15];
int homegoals;
int awaygoals;
};
void createleague(struct team leagueteams[]);
void displayleague(struct team leagueteams[]);
int main (void)
{
struct team leagueteams[MAXTEAMS];

printf("********************************** ");
printf("Welcome To The Premier League ");
printf("Type 10 Teams To Create The League");
printf(" ********************************** ");

createleague(leagueteams);
displayleague(leagueteams);

}
void createleague(struct team leagueteams[])
{
int t;
int g;
for (t=0;t<MAXTEAMS;t++)
{
printf(" Enter Team:");
scanf("%s",leagueteams[t].name);

leagueteams[t].pld = 0;
leagueteams[t].w=0;
leagueteams[t].d=0;
leagueteams[t].l=0;
leagueteams[t].pts=0;
}
for (g=0;g<MAXGAMES;g++)
{
leagueteams[t].games[MAXTEAMS] = 0;
}
}
void displayleague(struct team leagueteams[])
{
printf(" Premier League Table ");
printf(" ---------------------------------------------------
");
printf(" Name P W D L Pts ");
printf("-----------------------------------------------------
");

int d;

for (d=0;d<MAXTEAMS;d++)
{
printf("%15s %3d %3d %3d %3d %3d ", leagueteams[d].name,
leagueteams[d].pld, leagueteams[d].w, leagueteams[d].d,
leagueteams[d].l, leagueteams[d].pts);
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote