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

  Complete the 8 queens 2 dimensional array

Complete the 8 queens 2 dimensional array program with backtracking. please change the below program using backtracking  and please run before posting it . the program suppose to print 92 solution . amd also comment before each line to better unde..

  Can you provide the constructor

Can you provide the constructor, copy constructor, copy assignment operator, destructor, move copy constructor, and move assignment operator on "------" ?

  The mean and standard deviation

How do i write a program in c++ that use functions max, min, the total numbers, the mean and standard deviation to read a file text and return these values from the file text. note the file text has random numbers. note im not suppose to use arrays.

  The two-dimensional array

1. Given the two-dimensional array declared by the following statement int myArray[4][3] = {{2,4,6},{1,8,10},{3,5,7},[9,11,13}}; what is the value of myArray[1][2]

  How does using strings like integers alter the o-notation

How does using strings instead of simple types like integers alter the O-notation of operations? Is the ADT given in program 4.7 a first-class ADT? Explain your answer.

  Implement c code for drawing filled triangles

Calculate the size of a rectangle that is just large enough to contain the triangle. The bx, by, bw, and bh fields of the triangle data structure should be initialized with the appropriate values.

  Build a traffic light system - microcontroller system

Build the whole system with 3 RAG units and three puffin crossing units and build a team to work on this mini-project, be careful in selecting your team member.

  Write cpp program that processes the data of retail company

Write a C++ program that processes the data of a retail company with following requirements: Define a new data type (struct) ofCustomer, with following members

  Extend the definition of the class clocktype by overloading

a. Extend the definition of the class clockType by overloading the post-increment operator function as a member of the class clockType

  Define the cheetah constructor to accept and initialize

Design and implement a class called Cheetah that contains instance data that represents the cheetah's name, age, weight, length and gender.

  Desired file information viewer application

Therefore, she asks Hayley to modify the application to accept the name of a folder and display the following details of the files located in the folder: File name File size File creation date Write the code that Hayley should write to create the d..

  Write a program to find the max value

Write a program to find the max value in an unsigned char array[100].

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