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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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