| | |
help plz with grading program
![]() |
•
•
Join Date: May 2009
Posts: 1
Reputation:
Solved Threads: 0
hi
i need help with my grading program
i need to do something so the menu comes up and make it work property
i have no idea on my switch statement and how to delete student from list please help me
i need help with my grading program
i need to do something so the menu comes up and make it work property
i have no idea on my switch statement and how to delete student from list please help me
C Syntax (Toggle Plain Text)
#include <stdio.h> void main() { int ssn[1000]; int sex[1000]; char name[1000][30]; int Assignment_average[1000]; int Quiz_Average[1000]; int participation[1000]; int Midterm[1000]; int final[1000]; int i,j,menu; int cnt=0; int tot[1000]; double avr[1000]; int score[1000]; int best[1000]; printf("1.Print list of students\n3.Print list of those whom made an A grade\n4.Print list of those whom made an F grade\n5.Print list of students sorted by name\n6.add student to the class list\n7.delete student from class list\n8. quit",&menu ) scanf("%d",&menu); switch(menu) { case 1: case 2: case 3: case 4: } if(ssm[i]==-999) break; //add students printf("Input a Name! ="); scanf("%s",&name[i]); printf("Input a Assignment_average="); scanf("%d",&Assignment_average[i]); printf("Input a Quiz_Average="); scanf("%d",&Quiz_Average[i]); printf("Input a participation="); scanf("%d",&participation[i]); printf("Input a Midterm="); scanf("%d",&Midterm[i]); printf("Input a final="); scanf("%d",&final[i]); cnt++; } for(i=0;i { tot[i]=0.40*Assignment_average[i]+ Quiz_Average[i]*0.15+ participation[i]*0.10+Midterm[i]*0.15+ final[i]*0.20 avr[i]=tot[i]*100; }
•
•
Join Date: Oct 2007
Posts: 305
Reputation:
Solved Threads: 43
I would clean up the printf a bit by making it more readable. Also I am not sure why you are passing the argument "&menu" to your printf. Its incorrect in this context.
Something like this would be much easier to read.
And after you've read the menu, you need to perform the processing for the menu item selected in your switch case.
Something like this would be much easier to read.
C Syntax (Toggle Plain Text)
printf("1.Print list of students\n"); printf("3.Print list of those whom made an A grade\n"); printf("4.Print list of those whom made an F grade\n"); printf("5.Print list of students sorted by name\n"); printf("6.add student to the class list\n"); printf("7.delete student from class list\n"); printf("8. quit\n");
And after you've read the menu, you need to perform the processing for the menu item selected in your switch case.
C Syntax (Toggle Plain Text)
switch (menuitem){ case 1: // print list break; case 2: // print list of A students break; ... .... default: break; }
"Please don't kill the codes,Pay them some respect "
After all,they are "your" codes:
Complete their format at least....
Errors:
>Usage of "&menu" in printf is not only syntactically wrong but also useless.Why do you want to print value of menu there???
>The code :
is incorrect usage.If you want to pick the i th name then
is enough as per your declaration of name array.
After all,they are "your" codes:
c Syntax (Toggle Plain Text)
for(i=0;i { tot[i]=0.40*Assignment_average[i]+ Quiz_Average[i]*0.15+ participation[i]*0.10+Midterm[i]*0.15+ final[i]*0.20 avr[i]=tot[i]*100; }
Errors:
>Usage of "&menu" in printf is not only syntactically wrong but also useless.Why do you want to print value of menu there???
>The code :
c Syntax (Toggle Plain Text)
printf("Input a Name! ="); scanf("%s",&name[i]);
c Syntax (Toggle Plain Text)
scanf("%s",name[i]);
Last edited by csurfer; Jun 3rd, 2009 at 2:56 pm.
I Surf in "C"....
![]() |
Similar Threads
- grading program help (C++)
- Plz Plz Help!! C++ parking program (C++)
- Plz Help Urgently In My Program (C++)
- plz suggest me how to do this program (C)
- i not understand how i do this problem (C++)
- plz help (Visual Basic 4 / 5 / 6)
- MERGED: Deleting duplicates in an array (plz help me out!!!!!!!) (C)
Other Threads in the C Forum
- Previous Thread: creating fixed length file
- Next Thread: Fetching web pages in C / a simple wget equivalent?
| Thread Tools | Search this Thread |
adobe api array arrays binarysearch calculate char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators intmain() iso kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer posix power probleminc program programming pyramidusingturboccodes read recursion recv recvblocked repetition research scanf scheduling segmentationfault send shape socketprograming socketprogramming stack standard strchr string suggestions systemcall test unix urboc user variable voidmain() wab win32api windows.h







)...