My Assignment...Hu can help me???

Thread Solved

Join Date: Aug 2009
Posts: 31
Reputation: hket89 is an unknown quantity at this point 
Solved Threads: 0
hket89's Avatar
hket89 hket89 is offline Offline
Light Poster

Re: My Assignment...Hu can help me???

 
0
  #11
Aug 7th, 2009
Rily?
Then thx ya...hehe
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 201
Reputation: yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold 
Solved Threads: 35
yellowSnow's Avatar
yellowSnow yellowSnow is offline Offline
Posting Whiz in Training

Re: My Assignment...Hu can help me???

 
1
  #12
Aug 7th, 2009
<rant>
For crying out loud, is this a forum on how to shortcut the English language? Sometimes it feels like it's a tutorial on how to read friggin' SMS messages.
Originally Posted by hket89 View Post
Then u noe hw 2 use do-while loop mar?
u=you, noe=know,hw=how, 2=to, mar=anyone's guess
Originally Posted by hket89 View Post
Could u gv me the website tat can download c programing the notes n the example? Thx^^
u=you, gv=give, tat=that, n=and, thx=thanks
Originally Posted by itzAB View Post
I am too very new in C... I ll try to solve ur prob.....
ur=your,prob=problem

Here's the deal; in the examples I quoted, there is a difference of 19 characters between the crapshoot spelling and the correct spelling (not counting whatever the hell "mar" means).

Get on board and at least try to use proper English.
</rant>
Manic twiddler of bits
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 55
Reputation: itzAB is an unknown quantity at this point 
Solved Threads: 2
itzAB itzAB is offline Offline
Junior Poster in Training

Re: My Assignment...Hu can help me???

 
0
  #13
Aug 7th, 2009
Im to 100% sure.. I ll try my best...
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 55
Reputation: itzAB is an unknown quantity at this point 
Solved Threads: 2
itzAB itzAB is offline Offline
Junior Poster in Training

Re: My Assignment...Hu can help me???

 
0
  #14
Aug 7th, 2009
I could do only this.......
Rest is left upto you....
Reply if this was useful..
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. int i=0,a=0,b=0,c=0,dg=0,f=0;float ca=0,x;
  6. struct data
  7. {
  8. int sin; //student id no
  9. int t1; //test 1
  10. int t2; //test 2
  11. int tf;//final test
  12. float sa ;//sem average
  13. char grad;
  14. };
  15.  
  16.  
  17. struct data d[100];
  18. clrscr();
  19. for(i=0;i<=99;)
  20. {
  21. printf("Enter the student identification number:");
  22. scanf("%d",&d[i].sin);
  23. if(d[i].sin==0)
  24. break;
  25. printf("Enter the test marks of TEST 1,TEST 2,TEST 3 respectively\n");
  26. scanf("%d%d%d",&d[i].t1,&d[i].t2,&d[i].tf);
  27. d[i].sa=0.20*d[i].t1 +0.30*d[i].t2+0.50*d[i].tf;
  28. printf("SEMESTER AVERAGE= %f\n",d[i].sa);
  29. x=d[i].sa;
  30.  
  31. if((x<=100.00) && (x>=90.0))
  32. {
  33. d[i].grad='A';
  34. printf("The grade of student is A\n");
  35. a++;
  36. }
  37. if((x<=89.0) && (x>=80.0))
  38. {
  39. d[i].grad='B';
  40. printf("The grade of student is B\n");
  41. b++;
  42. }
  43. if((x<=79.0) && (x>=70.0))
  44. {
  45. d[i].grad='C';
  46. printf("The grade of student is C\n");
  47. c++;
  48. }
  49.  
  50. if((x<=69.0) && (x>=60.0))
  51. {
  52. d[i].grad='D';
  53. printf("The grade of student is D\n");
  54. dg++;
  55. }
  56. if((x<=59.0) && (x>=0.0))
  57. {
  58. d[i].grad='F';
  59. printf("The grade of student is F\n");
  60. f++;
  61. }
  62.  
  63. i++;
  64. }
  65. printf("The number of students having A grade : %d\n",a);
  66. printf("The number of students having B grade : %d\n",b);
  67. printf("The number of students having C grade : %d\n",c);
  68. printf("The number of students having D grade : %d\n",dg);
  69. printf("The number of students having F grade : %d\n",f);
  70.  
  71.  
  72. ca= (4*a+3*b+2*c+1*dg)/i;
  73. printf("Class Average is %f",ca);
  74. getch();
  75.  
  76. }
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 201
Reputation: yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold 
Solved Threads: 35
yellowSnow's Avatar
yellowSnow yellowSnow is offline Offline
Posting Whiz in Training

Re: My Assignment...Hu can help me???

 
0
  #15
Aug 7th, 2009
Since the OP seems to be happy (quote - "hehe") for someone to do his (or her) homework, all I'll say about your code is DO NOT USE void main().

And I'm sure the OP is 'rily' happy for you to do this.

The main function should be declared as:

- int main(), or
- int main(void), or
- int main(int argc, char *argv[]), or
- int main(int argc, char **argv)

Just shoot the void as the return type.
Last edited by yellowSnow; Aug 7th, 2009 at 1:47 pm.
Manic twiddler of bits
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 55
Reputation: itzAB is an unknown quantity at this point 
Solved Threads: 2
itzAB itzAB is offline Offline
Junior Poster in Training

Re: My Assignment...Hu can help me???

 
0
  #16
Aug 7th, 2009
Originally Posted by yellowSnow View Post
Since the OP seems to be happy (quote - "hehe") for someone to do his (or her) homework, all I'll say about your code is DO NOT USE void main().

And I'm sure the OP is 'rily' happy for you to do this.

The main function should be declared as:

- int main(), or
- int main(void), or
- int main(int argc, char *argv[]), or
- int main(int argc, char **argv)

Just shoot the void as the return type.
thanks for your correction.......
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 55
Reputation: itzAB is an unknown quantity at this point 
Solved Threads: 2
itzAB itzAB is offline Offline
Junior Poster in Training

Re: My Assignment...Hu can help me???

 
0
  #17
Aug 8th, 2009
One correction has to be done in the code..
No rank will be reported when sa is b/w 69 and 70.. and other similar cases..
hope you can correct it yourself
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 31
Reputation: hket89 is an unknown quantity at this point 
Solved Threads: 0
hket89's Avatar
hket89 hket89 is offline Offline
Light Poster

Re: My Assignment...Hu can help me???

 
0
  #18
Aug 9th, 2009
Whats the difference between void main() and int main()?
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 31
Reputation: hket89 is an unknown quantity at this point 
Solved Threads: 0
hket89's Avatar
hket89 hket89 is offline Offline
Light Poster

Re: My Assignment...Hu can help me???

 
0
  #19
Aug 10th, 2009
#include <stdio.h>

int main(){
int id_no, test1, test2, final_test, semester_average, count;

printf("\t\t* * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf("\t\t*_________________________________________________*\n");
printf("\t\t*| Welcome to My Programe |*\n");
printf("\t\t*|_______________________________________________|*\n");
printf("\t\t*|____SEMESTER AVERAGE______FINAL LETTER GRADE__|*\n");
printf("\t\t*| | |*\n");
printf("\t\t*| 90 – 100 | A |*\n");
printf("\t\t*| 80 – 89 | B |*\n");
printf("\t\t*| 70 – 79 | C |*\n");
printf("\t\t*| 60 – 69 | D |*\n");
printf("\t\t*| 0 – 59 | F |*\n");
printf("\t\t*|________________________|______________________|*\n");
printf("\t\t* * * * * * * * * * * * * * * * * * * * * * * * * *\n");

do{
printf("Enter the student ID no[4 digit]: \n");
scanf("%d", &id_no);
if(id_no < 1000 || id_no > 10000){
do{
printf("Invalid!!! The ID no must in 4 digit number.\n");
printf("Please enter the student ID no again: \n");
scanf("%d", &id_no);
}while(id_no < 1000 || id_no > 10000);

}

printf("Enter test score 1: \n");
scanf("%d", &test1);
if(test1 <= -1 || test1 > 101)
{
do{
printf("Invalid!!!\n");
printf("Please enter the test for score 1 again: \n");
scanf("%d", &test1);
}while(test1 <= -1 || test1 > 101);
}

printf("Enter test score 2: \n");
scanf("%d", &test2);
if(test2 <= -1 || test2 > 101)
{
do{
printf("Invalid!!!\n");
printf("Please enter the test for score 2 again: \n");
scanf("%d", &test2);
}while(test2 <= -1 || test2 > 101);
}

printf("Enter test final score: \n");
scanf("%d", &final_test);
if(final_test <= -1 || final_test > 101)
{
do{
printf("Invalid!!!\n");
printf("Please enter the test for final again: \n");
scanf("%d", &final_test);
}while(final_test <= -1 || final_test > 101);
}

semester_average = 0.20 * test1 + 0.30 * test2 + 0.50 * final_test;

printf("Semester average for student %d: %d\n", id_no, semester_average);
printf("Press 1 to continue or press 0 to exit the programe.\n");
scanf("%d", &count);
}while(count != 0);

printf("Thanks 4 using.\n");

return 0;

}
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 31
Reputation: hket89 is an unknown quantity at this point 
Solved Threads: 0
hket89's Avatar
hket89 hket89 is offline Offline
Light Poster

Re: My Assignment...Hu can help me???

 
0
  #20
Aug 10th, 2009
I try 2 cr8 a program to my assignment, bt din fin yet...
Please have a look at my program n gv sm advise...Thx^^
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 1157 | Replies: 21
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC