Calculate the average of three exams

Assignment Help C/C++ Programming
Reference no: EM131110617

Code a program in C that will calculate the average of 3 exams for an undetermined # of students.

I have been given a base code that I must modify using a sentinel that will stop the loop counter. I can not seem to code the loop to accept the break.

Base Code:
#include <stdio.h>
int main ()
{
/* variable definition: */
char StudentName[100];
float ExamValue, Sum, Avg;
int students,exams;
// Loop through 5 Students
for (students=0; students <5 ; students++)
{
// reset Sum to 0
Sum =0.0;
printf("Enter Student Name n");
scanf("%s", StudentName);
// Nested Loop for Exams
for (exams=0; exams < 3; exams++)
{
printf ("Enter exam grade: n");
scanf("%f", &ExamValue);
Sum += ExamValue;
}
Avg = Sum/3.0;
printf( "Average for %s is %fn",StudentName,Avg);
}
return 0;
}

Reference no: EM131110617

Questions Cloud

Compute net cash flow from operating activities : 1. The net income for Letterman Company for 2010 was $320,000. During 2010, depreciation on plant assets was $124,000, amortization of patent was $40,000, and the company incurred a loss on sale of plant assets of $21,000. Compute net cash flow from ..
Write a program in c++ to accept a string : Write a program in C++ to accept a String and print the total no of vowels in it. Also print the string in upper and lower case
The art of oratory discussion question : After watching several films (or plays) over your lifetime, and now reading Syd Field's theory on the Three-Act-Paradigm, what do you notice about the commonalities of good presentations?
What shape will require the least amount of material : A Y-shaped metal bracket is to be made such that its height is 10.0 cm and its width across the top is 6.00 cm. What shape will require the least amount of material? See Fig. 27.52.
Calculate the average of three exams : Code a program in C that will calculate the average of 3 exams for an undetermined # of students.
How has the legal system evolved : How has the legal system evolved, as it applies to special education over the past 20 years, and how has that affected the legal framework for special education today?
The board of directors of gifford corporation : The board of directors of Gifford Corp. declared cash dividends of $260,000 during the current year. If dividends payable was $85,000 at the beginning of the year and $90,000 at the end of the year, how much cash was paid in dividends during the year..
Sketch a graph of the cross-sectional area a : Sketch a graph of the cross-sectional area A as a function of See Fig. 27.53.
Career portfolio on career summary : For this part of the assignment you'll complete a career summary which includes several parts including your desired outcome and career goals: your "Mission Statement" (which may be very similar to your statement of career objectives), a summary o..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Takes 100 number in an array

Write a program in c++ that takes 100 number in an array and add them and print the sum

  Write a program that computes the cost of long distance call

Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules.

  Design a deck plan space ship in eclipse

Develop a simple interactive two-dimensional spaceship deck plan editor using OpenGL and GLUT. Your program will enable a user to create and save a deck plan of a hypothetical spaceship comprising the hull walls.

  Design an instruction that useful for handling while loops

The loop instructions discussed in the text were for handling for loops. Design an instruction that might be useful for handling common while loops instead.

  Find the largest element and print out the index and value

Write a function maxv() that returns the largest element of a vector argument. Find the largest element and print out the index and value.

  C program that displays the sales tax amount for each store

It will be necessary for you to access Service Request: ¿SR-kf-008, Tax Calculator¿ from the Virtual Organizations portal. Complete Change Request #1. Insert comments in the program to document the program internally. Attach a design flow chart to..

  Create an rmi service for addition and factorial

Create an RMI service for "addition" and "factorial". The service will define two remote functions - add() and factorial(). The add() function will take two integers as parameters and return the addition of these numbers.

  Cpp program display overtime or regular time pay calculation

Display overtime or regular time pay calculations. See the sample output. Implement object calculations by summarizing your employee objects and display the summary information in the example.

  A class definition for a date class that contains 3 integer

A class definition for a Date class that contains three integer data members: month, day, and year.

  Write the class declaration for a class named complex

Write the class declaration for a class named Complex using the class diagram

  Write a program that reads an array with wind-tunnel test

write a program that reads an array with wind-tunnel test data then allowss the user to enter a flight-path angle. If the angle is within the bounds of the data set, the program should then use linear inteerpolation to compute the corresponding coeff..

  Explain the two different uses of the keyword virtual

Explain the two different uses of The keyword virtual

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd