Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
0Activity
0 of .
Results for:
No results containing your search query
P. 1
Analyser

Analyser

Ratings: (0)|Views: 0 |Likes:
Published by Yao Xiang Ter
Nth
Nth

More info:

Published by: Yao Xiang Ter on Oct 13, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

10/13/2013

pdf

text

original

 
#include<stdio.h>void print_menu();int main(void) {int num, choice;int max = 0, min = 100;int count = 0;float aveMarks = 0;int ngradeA = 0, ngradeB = 0, ngradeC = 0, ngradeD = 0, ngradeF = 0;do {printf("Enter mark (negative number to end): ");scanf("%d", &num);if (num > 0) {if (num > max)max = num;if (num < min)min = num;aveMarks += num;count++;}} while (num >= 0);aveMarks /= count;do {print_menu();scanf("%d", &choice);switch (choice) {case 1: printf("\nThe maximum and minimum are %d and %drespectively.\n", max,min); break;case 2: printf("\nThe average mark is %.2f.\n", aveMarks); break;case 3: print_grade_frequency_table(ngradeA,ngradeB,ngradeC,ngradeD,ngradeE); break;case 4: print_histogram(ngradeA,ngradeB,ngradeC,ngradeD,ngradeE); break;}printf("\n");} while (choice != 5);printf("Thank you and goodbye!");return 0;}void print_menu(void) {printf("1. Show maximum and minimum marks\n");printf("2. Show average mark\n");printf("3. Show grade frequency table\n");printf("4. Show grade histogram\n");printf("5. Exit\n");printf("Select your choice")}void print_grade_frequency_table(int ngradeA, int ngradeB, int ngradeC, int ngradeD, int ngradeF) {printf("\nGrade Frequency Table")printf("=====================\n");printf("A: %d\n", ngradeA);printf("B: %d\n", ngradeB);printf("C: %d\n", ngradeC);

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->