I'm on my last question, and I have no idea where I start. I tried though.
A bowling team consists of five players. Each player bowls three games. Write a C program that uses a nested loop to enter each players individual scores and then computes and displays the average score for each bowler. Assume that each bowler has the following scores:
#include <stdio.h>
int main()
{
float averageScore;
int bowler;
int score1;
int score2;
int score3;
for (bowler=1;bowler<=5;bowler++)
{
averageScore=0;
for(score1;score<=2;score++){
printf("1st bowler: Average score for bowler 1 is %3.2f\n", averageScore)
averageScore= (score1+score2+score3)/(3)
}
}
}
you must initialize them to 0. PlayerAverageScore[Players] = {0.0}; Then have one variable for inputting like int Score; in your loop you will have to get 3 inputs for each score then add them to the average score of that player and then divide by 3 (number of scores).
Something like this to get you started:
1 2 3 4 5 6 7 8
constint bowlers = 5;
for( int bowler = 0; bowler < bowlers; ++bowler )
{
//read in 3 scores and add to average score
//divide the average score of that player by 3
}
//output the players average scores.
#include <stdio.h>
int main()
{
float averageScore;
int bowler;
int score1;
int score2;
int score3;
constint bowlers = 5;
for( int bowler = 0; bowler < bowlers; ++bowler )
{
scanf("%d")
}
//output the players average scores.
}