Ask your own question, for FREE!
Computer Science 29 Online
OpenStudy (anonymous):

2. Write a program to calculate CGPA of a student. The program should be able to get input from the user of the grade for each course. Use data in Table 1 and Table 2 as to calculate the CGPA. Course Credit Hour Mathematics 5 Physics 5 Chemistry 5 Computer 5 BEL 3 CTU 2 Table 1: Course Information Grade Point A 4.00 B 3.00 C 2.00 Table 2: Grade Information

OpenStudy (anonymous):

U wanna solve it in which language c, c++, java ,python?? Kindly specify

OpenStudy (anonymous):

C

OpenStudy (anonymous):

C or C++

OpenStudy (anonymous):

ohk. . :)

OpenStudy (anonymous):

ok , I'm waiting . . . . . . .

OpenStudy (anonymous):

we have to get the input as grade from the user for each course example mathematics, physics etc.?? Is it necessary to get input for each course?? well i mean to say the user maight not be taking all the courses. . or do we have to take input for all the courses?? secondly what does credit hour stands for?? How do we hv to use in the programme??

OpenStudy (anonymous):

yes , we have to take input for all the courses Mathematics 4 Physics 4 Chemistry 4 Computer 3 BEL 3 Total 18 credit hour stands

OpenStudy (anonymous):

90 to 100 = A 80 to 89 = B 70 to 79 = c 60 to 69 = D lessthen 60 = F

OpenStudy (anonymous):

Since we dont have CGPA system in my country?? What is the formula to calculate it ??

OpenStudy (anonymous):

Total grage divided by total credit hour

OpenStudy (anonymous):

ohk so wht we will be doing here is to get the input as Grade from the user for each course and then finding out the total sum of the points. . and then divide it by the total sum of respective credit hour?? do i sound correct??

OpenStudy (anonymous):

yes , extly right

OpenStudy (anonymous):

ohk wait. . m trying :)

OpenStudy (anonymous):

ok

OpenStudy (anonymous):

For Example : Mathematics = ( Gradre poin 2 ) ( Grade Hours 3 ) that means grade poin 2*3 = 6 Physics ( Gradre poin 3 ) ( Grade Hours 3 ) that means grade poin 3*3 = 9 Chemistry ( Gradre poin 2 ) ( Grade Hours 3 ) that means grade poin 2*3 = 6 here Total credit Hours 3+3+3 = 9 and Grade poin 6+9+6=21 So CGPA = 21/9

OpenStudy (anonymous):

21/9 = 2.333

OpenStudy (anonymous):

ohhh mistak not gradre hours its credit hours

OpenStudy (anonymous):

ohk but credit hours are given to us for each course they r predefined. . we dont have to get them as input frm the user??

OpenStudy (anonymous):

yes , credit hour is fixed , user can't input credit hours

OpenStudy (anonymous):

ohk :)

OpenStudy (anonymous):

For Mathematics 3 credit hours Physics 3 Chemistry 3 Computer 3 BEL 3 Fixed

OpenStudy (anonymous):

but in the question u said Course Credit Hour Mathematics 5 Physics 5 Chemistry 5 Computer 5 BEL 3 CTU 2 Table 1: Course Information

OpenStudy (anonymous):

ok do anyone , thats not problem after solv the problem then i can edit it

OpenStudy (anonymous):

ohk

OpenStudy (anonymous):

i need just the formate of the programe

OpenStudy (anonymous):

ohk wait. . I will be doing it for maths and physics. . u will get the idea how to do the rest:)

OpenStudy (anonymous):

ohkkkk ,

OpenStudy (anonymous):

#include<stdio.h> #include<conio.h> void main() { int a=0, b=0; float cgpa; char m,bel,; printf("Enter the grade obtained in Mathematics"); scanf("%c",&m); if(m=='A')||(m=='a) a=(a+4)*5 if(m=='B')||(m=='b') a=(a+3)*5 if(m=='C')||(m=='c') a=(a+2)*5 b=b+5 printf("Enter the grade obtained in BEL"); scanf("%c",&bel); if(bel=='A')||(bel=='a) a=(a+4)*3 if(bel=='B')||(bel=='b') a=(a+3)*3 if(bel=='C')||(bel=='c') a=(a+2)*3 b=b+3 cgpa=a/b printf("The cgpa=%f",cgpa) } To make it clear. . i have used for BEL instead of physics . . coz it's credit hour is 3. . differnt frm physics n maths :p

OpenStudy (anonymous):

okkk :) , w8 im cheking

OpenStudy (anonymous):

I havnt checked in the turbo c compiler. . so it may be having some syntax errors. .

OpenStudy (anonymous):

ok

OpenStudy (anonymous):

check it . n lemme knw :)

OpenStudy (anonymous):

oww , its working , many many tnx for your help :)

OpenStudy (anonymous):

np. . my pleasure :)

OpenStudy (anonymous):

see you next time now bye

OpenStudy (anonymous):

biee. . . u can contact me if u encounter further problem mail id is mallika454@gmail.com

OpenStudy (anonymous):

ok tnx

OpenStudy (anonymous):

hey boss , whats up?

OpenStudy (anonymous):

Nothing much :) N u ??

OpenStudy (anonymous):

i'm fine , but i hav a new problem :p

OpenStudy (anonymous):

#include<stdio.h> void main() { struct srecord { int r; char n[50]; float m; } s1[4]; for(int i=0;i<=2;i++) { cout<<"Please enter Student ("<<i+1<<")\n\t"; cout<<"Roll:"; cin>>s1[i].r; cout<<"\tName:"; cin>>s1[i].n; cout<<"\tMarks:"; cin>>s1[i].m; } cout<<endl; for(int i=0;i<=2;i++) { cout<<"Student ("<<i+1<<")\n\t"; cout<<"Roll:"<<s1[i].r; cout<<"\n\tName:"<<s1[i].n; cout<<"\n\tMarks:"<<s1[i].m; cout<<endl; } cout<<endl; }

OpenStudy (anonymous):

where ??

OpenStudy (anonymous):

its not working i can't find out the mistak

OpenStudy (anonymous):

put up the code here

OpenStudy (anonymous):

#include<stdio.h> void main() { struct srecord { int r; char n[50]; float m; } s1[4]; for(int i=0;i<=2;i++) { cout<<"Please enter Student ("<<i+1<<")\n\t"; cout<<"Roll:"; cin>>s1[i].r; cout<<"\tName:"; cin>>s1[i].n; cout<<"\tMarks:"; cin>>s1[i].m; } cout<<endl; for(int i=0;i<=2;i++) { cout<<"Student ("<<i+1<<")\n\t"; cout<<"Roll:"<<s1[i].r; cout<<"\n\tName:"<<s1[i].n; cout<<"\n\tMarks:"<<s1[i].m; cout<<endl; } cout<<endl; }

OpenStudy (anonymous):

what r u trying to do here in this programme ??

OpenStudy (anonymous):

make a Student list with roll , name and mark and roll , name , mark input from user

OpenStudy (anonymous):

nop im not Zeeshan Nasir , im Mamun

OpenStudy (anonymous):

OpenStudy (anonymous):

please chek it

OpenStudy (anonymous):

ohk

OpenStudy (anonymous):

at the end use getch() maybe that helps out and also use #include<conio.h> after stdio.h

OpenStudy (anonymous):

ok , im trying

OpenStudy (anonymous):

ya lemme knw

OpenStudy (anonymous):

same error :'(

OpenStudy (anonymous):

ohk wait

OpenStudy (anonymous):

ok

OpenStudy (anonymous):

Ahaan. . u r doing it in c++. . so u need to define header file <iostream.h>. . standard input output and not <stdio,h> (that's for c) Moreover the code that u hv pasted is in c++ whereas the tyj.pnj is in c. . Mate. . first make it clear in which language u wanna make uar programme becoz uar logic is correct. . just the syntax prob CHEERS

OpenStudy (anonymous):

First i need c not c++ that means tyj.pnj

OpenStudy (anonymous):

then paste the code in c. . and not c++ plz

OpenStudy (anonymous):

ok

OpenStudy (anonymous):

#include <stdio.h> void main() { struct info { int roll; char name[30]; float marks; }student[5]; int i; printf("Plz Enter the name,roll & marks of the students 1 by 1."); for(i=0;i<5;i++) { scanf("%s %d %f",student[i].name,&student[i].roll,&student[i].marks); } printf("\n\n\tName \tRoll \tMarks"); for(i=0;i<5;i++) { printf("\n%d \t%s \t%d \t%f",i+1,student[i].name,student[i].roll,student[i].marks); } }

OpenStudy (anonymous):

ERROR IN for(i=0;i<5;i++) { scanf("%s %d %f",student[i].name,&student[i].roll,&student[i].marks); } IT SHOULD BE scanf("%s %d %f",&student[i].name u missed that &

OpenStudy (anonymous):

ok wait please , cheking

OpenStudy (anonymous):

Oppss! nop , same error

OpenStudy (anonymous):

also it should be %c and not %s

OpenStudy (anonymous):

ok , today im trying if i can't solv it then tomorw again i call you , now bye Take cate Good Night

OpenStudy (anonymous):

give me uar mail. . i will mail u

OpenStudy (anonymous):

jahidalmamun@yahoo.com

OpenStudy (anonymous):

alrt. . I will mail u. . Gudnyt is the word :)

OpenStudy (anonymous):

ok , Good Night u tooo

OpenStudy (anonymous):

:)

OpenStudy (anonymous):

#include<stdio.h> #include<conio.h> #include<string.h> struct student { char name[25]; int roll; int marks[3]; }; void main() { int i,n; struct student st[40]; clrscr(); printf("Enter how many students: "); scanf("%d",&n); /* for loop to read the names and roll numbers and marks obtained*/ for(i=0;i<n;i++) { printf("\nEnter name for student %d : ",i+1); scanf("%s",&st[i].name); printf("\nEnter rollnumber for student %d : ",i+1); scanf("%d",&st[i].roll); printf("\nEnter marks for student %d : ",i+1); scanf("%f",&st[i].marks); } /* for loop to print the names and roll numbers and marks obtained*/ for(i=0;i<n;i++) { printf("\n The name of student %d :%s ",i+1,st[i].name); printf("\n The name of student %d :%d ",i+1,st[i].roll); printf("\n The name of student %d :%f",i+1,st[i].marks); } getch(); } Check it out

OpenStudy (anonymous):

Thank You for your reply but there have an error :'(

OpenStudy (anonymous):

I dont knw which compiler u are using. . so since it is showing error with clrscr() try to remove that. . maybe it works .... I usually use turbo c compiler

OpenStudy (anonymous):

ok , im trying

OpenStudy (anonymous):

Yup

OpenStudy (anonymous):

ha ha ha ha , Thank you now its working , Thank you

OpenStudy (anonymous):

Oh m glad. . finally. . uar welcome :) by the way which compiler r u using ??

OpenStudy (anonymous):

Code Block

OpenStudy (anonymous):

ohk

OpenStudy (anonymous):

codeblocks-10.05mingw-setup

OpenStudy (anonymous):

oh. . I usually use dev c++ or turbo c . . turbo c is the best. .

OpenStudy (anonymous):

yap turbo c is best i know but code block is stylish :D

OpenStudy (anonymous):

he he. . Amazing. . which country r u frm ??

OpenStudy (anonymous):

Bangladesh

OpenStudy (anonymous):

u pakistan?

OpenStudy (anonymous):

No. . who said?? m frm India. .

OpenStudy (anonymous):

owww

OpenStudy (anonymous):

Neighbours :)

OpenStudy (anonymous):

yap

OpenStudy (anonymous):

tumara nam moli ho , :D

OpenStudy (anonymous):

u knw Hindi :p ??

OpenStudy (anonymous):

it's my pet name

OpenStudy (anonymous):

kuch kuch

OpenStudy (anonymous):

ohk :)

OpenStudy (anonymous):

mera ek brother live in india permanatly from childhd

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Austinsbabygirl4life: Texas schools look funn
2 hours ago 0 Replies 0 Medals
chuu: Is it (Hunt 30-31) or (Hunt 30-1) in MLA?
2 hours ago 0 Replies 0 Medals
luvnickk: what typa music yall listen to ?
3 hours ago 15 Replies 2 Medals
GothgirlLillian: Is music considered art?
3 hours ago 2 Replies 0 Medals
luvnickk: am newwww
7 hours ago 0 Replies 0 Medals
russianmafiya: can someone help me write a love song
8 hours ago 1 Reply 0 Medals
arrivhn: ADD ME ON DISCORD ICYAFFL
8 hours ago 4 Replies 1 Medal
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!