Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

The original program is supposed to ask the user to enter 3 grades for 5 students, and then calculate the average for each student and for each exam:
(MODIFICATIONS AT BOTTOM)

_______________________________________________________________________________________
#include
int main()
{
int grades[5][3];
int student, exam;
int sum;
float average;
for (exam=0; exam<3; exam++){
printf(" Exam %i \n", exam+1);
printf("-----------------------\n");
for( student = 0; student < 5; student++){
printf("Grade for student %i: ", student + 1);
scanf("%i", &grades[student][exam]);
}
printf("\n"); }
printf("\n");
for (exam=0; exam < 3; exam++){
sum = 0;
for( student = 0; student < 5; student++){
sum += grades[student][exam];}
average = sum / 5.0;
printf("The average for exam %i is: %3.2f \n", exam + 1, average);
}
printf("\n");
for( student = 0; student < 5; student++){
sum = 0;//make sure the sum is cleared when we start a new average
for (exam= 0; exam < 3; exam++){
sum += grades[student][exam];}
average = sum / 3.0;
printf("The average for student %i is: %3.2f \n", student + 1, average);
}
printf("\n");
return 0;
}

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9885526

Have any Question?


Related Questions in Computer Engineering

Question will services follow the trend of manufacturing in

Question : Will services follow the trend of manufacturing in being outsourced and offshored from industrial countries to developing countries? Are all services at risk of being offshored? The response must be typed, sin ...

What are the assumptions of linear regression analysis and

What are the assumptions of linear regression analysis and ,How do we interpret the regression coefficients ,can u give a real life example of how linear regression is used in statistical research

Scenarioyour friend tim hall is an expert in creating

Scenario Your friend, Tim Hall, is an expert in creating websites. In Hall's opinion, creation of websites is now a simple task using tools such as Adobe Dreamweaver, and therefore, he does not feel the need to learn HTM ...

1 write code in the method linearsearch in

1. Write code in the method linearSearch() in "SearchMethods"class which finds the element in an array using linear search approach and returns its index to the calling main method, otherwise it returns -1. 2. Write code ...

Assignment wireless applications advances advantages and

Assignment: Wireless Applications, Advances, Advantages, and Disadvantages The adoption of wireless technologies varies from one industry to another, and is often based on the benefits provided versus the challenges, imp ...

What are the differences between server a mainframe and a

What are the differences between server, a mainframe, and a supercomputer? What is productively software? Name the widely used productively suite available from Microsoft?

What is the example of social behavior or a social

What is the example of social behavior or a social situation that seems inconsistent with the fundamental presupposition, and why this example could be inconsistent?

Case study 1 requirement analysis and gathering for the

Case Study 1: Requirement Analysis and Gathering for the State Firefighters Association Read the mini case on The State Firefighters Association located in Chapter 3 of the textbook and complete the assignment. Write a t ...

How social capital enhance well-being in high density

How Social Capital enhance well-being in high density community?

The expectations theory suggests thata the slope of the

The expectations theory suggests that a.) the slope of the yield curve reflects the risk premium incorporated into the yields on long-term bonds. b.)the yield curve should usually be upward-sloping. c.)the slope of the y ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As