help plz with grading program

Reply

Join Date: May 2009
Posts: 1
Reputation: wislean is an unknown quantity at this point 
Solved Threads: 0
wislean wislean is offline Offline
Newbie Poster

help plz with grading program

 
0
  #1
May 31st, 2009
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

  1. #include <stdio.h>
  2.  
  3.  
  4. void main()
  5. {
  6.  
  7. int ssn[1000];
  8. int sex[1000];
  9. char name[1000][30];
  10. int Assignment_average[1000];
  11. int Quiz_Average[1000];
  12. int participation[1000];
  13. int Midterm[1000];
  14. int final[1000];
  15. int i,j,menu;
  16. int cnt=0;
  17. int tot[1000];
  18.  
  19. double avr[1000];
  20. int score[1000];
  21. int best[1000];
  22.  
  23. 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 )
  24. scanf("%d",&menu);
  25.  
  26. switch(menu)
  27. {
  28. case 1:
  29. case 2:
  30. case 3:
  31. case 4:
  32. }
  33.  
  34.  
  35. if(ssm[i]==-999) break; //add students
  36. printf("Input a Name! =");
  37. scanf("%s",&name[i]);
  38. printf("Input a Assignment_average=");
  39. scanf("%d",&Assignment_average[i]);
  40. printf("Input a Quiz_Average=");
  41. scanf("%d",&Quiz_Average[i]);
  42. printf("Input a participation=");
  43. scanf("%d",&participation[i]);
  44. printf("Input a Midterm=");
  45. scanf("%d",&Midterm[i]);
  46. printf("Input a final=");
  47. scanf("%d",&final[i]);
  48. cnt++;
  49. }
  50.  
  51.  
  52.  
  53. for(i=0;i {
  54. 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;
  55. }
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: help plz with grading program

 
0
  #2
May 31st, 2009
Ooh, yet another grade supersystem...

Better try to search DaniWeb for grade. There are lots of dozens of grade calculation threads (solved)...
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 305
Reputation: stilllearning has a spectacular aura about stilllearning has a spectacular aura about 
Solved Threads: 43
stilllearning stilllearning is offline Offline
Posting Whiz

Re: help plz with grading program

 
0
  #3
Jun 3rd, 2009
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.

  1. printf("1.Print list of students\n");
  2. printf("3.Print list of those whom made an A grade\n");
  3. printf("4.Print list of those whom made an F grade\n");
  4. printf("5.Print list of students sorted by name\n");
  5. printf("6.add student to the class list\n");
  6. printf("7.delete student from class list\n");
  7. 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.

  1. switch (menuitem){
  2. case 1:
  3. // print list
  4. break;
  5. case 2:
  6. // print list of A students
  7. break;
  8. ...
  9. ....
  10.  
  11. default:
  12. break;
  13. }
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 476
Reputation: csurfer is just really nice csurfer is just really nice csurfer is just really nice csurfer is just really nice csurfer is just really nice 
Solved Threads: 76
csurfer's Avatar
csurfer csurfer is offline Offline
Posting Pro in Training

Re: help plz with grading program

 
0
  #4
Jun 3rd, 2009
"Please don't kill the codes,Pay them some respect "
After all,they are "your" codes:
  1. for(i=0;i {
  2. 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;
  3. }
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 :
  1. printf("Input a Name! =");
  2. scanf("%s",&name[i]);
is incorrect usage.If you want to pick the i th name then
  1. scanf("%s",name[i]);
is enough as per your declaration of name array.
Last edited by csurfer; Jun 3rd, 2009 at 2:56 pm.
I Surf in "C"....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC