CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sun, 24 Aug 2025 10:36:29 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20080502121945
location: https://web.archive.org/web/20080502121945/https://www.daniweb.com/code/snippet855.html
server-timing: captures_list;dur=0.704192, exclusion.robots;dur=0.023108, exclusion.robots.policy;dur=0.011295, esindex;dur=0.014899, cdx.remote;dur=16.960813, LoadShardBlock;dur=309.009120, PetaboxLoader3.datanode;dur=106.040420, PetaboxLoader3.resolve;dur=141.170131
x-app-server: wwwb-app214
x-ts: 302
x-tr: 358
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app214; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sun, 24 Aug 2025 10:36:29 GMT
content-type: text/html; charset=utf-8
x-archive-orig-date: Fri, 02 May 2008 12:19:44 GMT
x-archive-orig-server: Apache/2.2
x-archive-orig-x-powered-by: PHP/5.1.6
x-archive-orig-set-cookie: bblastactivity=0; expires=Sat, 02-May-2009 12:19:44 GMT; path=/; domain=.daniweb.com
x-archive-orig-cache-control: private
x-archive-orig-pragma: private
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Fri, 02 May 2008 12:19:45 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 02 May 2008 12:19:45 GMT", ; rel="memento"; datetime="Fri, 02 May 2008 12:19:45 GMT", ; rel="next memento"; datetime="Fri, 02 May 2008 16:13:37 GMT", ; rel="last memento"; datetime="Fri, 02 May 2008 16:13:37 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_3_20080502065046_crawl108-c/52_3_20080502121939_crawl104.arc.gz
server-timing: captures_list;dur=0.733515, exclusion.robots;dur=0.026381, exclusion.robots.policy;dur=0.010196, esindex;dur=0.014624, cdx.remote;dur=6.236631, LoadShardBlock;dur=81.421180, PetaboxLoader3.datanode;dur=113.664864, load_resource;dur=132.355783, PetaboxLoader3.resolve;dur=83.489705
x-app-server: wwwb-app214
x-ts: 200
x-tr: 317
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
Simple grading report - cplusplus
Simple grading report
•
•
•
•

What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 322,721 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,042 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
The code prompts the user for a student name and the marks then prints out the report with a letter grade..It also asks the user for the file name and stores the data in the file.
/*Generates a simple grading report for each student*/ #include <stdio.h> #define LEN 25 #define S 5 struct stud_rec { char name[LEN+1]; float num_grade; char let_grade; }; struct stud_rec records[S]; void letter_grade(double average, double points); main() { int n,b,i,rec; char fname[LEN+1]; double points,average; FILE *fp; printf("Please Enter a file name to store the data: "); scanf ("%s", &fname); fp = fopen(fname, "w"); printf("How many records do you want to enter?: "); scanf("%d", &rec); for(i=0;i<rec;i++) { printf("Enter the student name: "); scanf("%s", &records[i].name); fprintf(fp,"\n%s\n",records[i].name); n=0; for (b=0;b<S;b++) { n++; printf("Enter Grade %d: ",n); scanf("%f", &records[b].num_grade); fprintf(fp,"%.1f ", records[b].num_grade); } printf("\n"); printf("My Grading Report\n"); printf("Student Grade1 Grade2 Grade3 Grade4 Grade5 Tpts FinalGrade LetterGrade\n"); printf("--------------------------------------------------------------------------------\n"); printf("%s", records[i].name); for (b=0;b<S;b++) { printf("\t %.1f",records[b].num_grade); } points=0; for(b=0;b<S;b++) { points=points+records[b].num_grade; } average = (points/S); printf("\t %.1f",points); printf("\t %.1f", average); letter_grade(average,points); printf("\n"); printf("--------------------------------------------------------------------------------\n"); printf("Class Average: %.lf\n\n", average); } fclose(fp); return 0; } void letter_grade(double average, double points) { if (average>=80) { printf("\t\tA"); } if ((average>=70) && (average<80)) { printf("\t\tB"); } if ((average>=60)&&(average<70)) { printf("\t\tC"); } if ((average>=50)&&(average<60)) { printf("\t\tD"); } else if(average<50) { printf("\t\tF"); } }
Post Comment
•
•
•
•
DaniWeb Marketplace (Sponsored Links)
- Today's Posts
- Unanswered Threads
Related Features
DANIWEB FEATURE INDEX
ADVERTISEMENT
STATISTICS