| | |
My Assignment...Hu can help me???
Thread Solved |
<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.
u=you, noe=know,hw=how, 2=to, mar=anyone's guess
u=you, gv=give, tat=that, n=and, thx=thanks
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>
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.
u=you, noe=know,hw=how, 2=to, mar=anyone's guess
•
•
•
•
Could u gv me the website tat can download c programing the notes n the example? Thx^^
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
•
•
Join Date: Jul 2009
Posts: 55
Reputation:
Solved Threads: 2
I could do only this.......
Rest is left upto you....
Reply if this was useful..
Rest is left upto you....
Reply if this was useful..
C Syntax (Toggle Plain Text)
#include<stdio.h> #include<conio.h> void main() { int i=0,a=0,b=0,c=0,dg=0,f=0;float ca=0,x; struct data { int sin; //student id no int t1; //test 1 int t2; //test 2 int tf;//final test float sa ;//sem average char grad; }; struct data d[100]; clrscr(); for(i=0;i<=99;) { printf("Enter the student identification number:"); scanf("%d",&d[i].sin); if(d[i].sin==0) break; printf("Enter the test marks of TEST 1,TEST 2,TEST 3 respectively\n"); scanf("%d%d%d",&d[i].t1,&d[i].t2,&d[i].tf); d[i].sa=0.20*d[i].t1 +0.30*d[i].t2+0.50*d[i].tf; printf("SEMESTER AVERAGE= %f\n",d[i].sa); x=d[i].sa; if((x<=100.00) && (x>=90.0)) { d[i].grad='A'; printf("The grade of student is A\n"); a++; } if((x<=89.0) && (x>=80.0)) { d[i].grad='B'; printf("The grade of student is B\n"); b++; } if((x<=79.0) && (x>=70.0)) { d[i].grad='C'; printf("The grade of student is C\n"); c++; } if((x<=69.0) && (x>=60.0)) { d[i].grad='D'; printf("The grade of student is D\n"); dg++; } if((x<=59.0) && (x>=0.0)) { d[i].grad='F'; printf("The grade of student is F\n"); f++; } i++; } printf("The number of students having A grade : %d\n",a); printf("The number of students having B grade : %d\n",b); printf("The number of students having C grade : %d\n",c); printf("The number of students having D grade : %d\n",dg); printf("The number of students having F grade : %d\n",f); ca= (4*a+3*b+2*c+1*dg)/i; printf("Class Average is %f",ca); getch(); }
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.
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
•
•
Join Date: Jul 2009
Posts: 55
Reputation:
Solved Threads: 2
•
•
•
•
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.
#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;
}
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;
}
![]() |
Similar Threads
- Java Assignment Help Needed!!!!!!!!!! (Java)
- Help needed with VB Assignment (Visual Basic 4 / 5 / 6)
- Many Errors while doing this assignment (C)
- I need help on my 'address book' assignment! (C++)
Other Threads in the C Forum
- Previous Thread: GOTO command
- Next Thread: Help with C programming
Views: 1157 | Replies: 21
| Thread Tools | Search this Thread |
Tag cloud for C
.net api array arrays binary binarysearch c++ char character code codeblocks coke command conversion convert cpu curl database decimal directory dude dynamic ebooks engrish error exec factorial fgets file fork function functions getlasterror givemetehcodez grade graphics hardware homework i/o input insert int integer lazy libcurl line linked linkedlist linux list lists locate loop malloc matrix memory motherboard mysql no-effort output path pointer pointers prime problem process program programming read recursion recursive recv recvblocked reverse scanf select shape single socketprograming socketprogramming special spoonfeeding static string strings strtok structures student system systemcall tftp turbo-c turboc unbuffered unix user variable va_list windows windows-mobile





