- 1

Please can someone correct my coding

#include <iostream> #include <iomanip> #include <cmath> /*This program is to determine the grades of ICT students in Ho Technical University*/ int main() { int af, cl, prg, m, mict, dm, cs; double score; cout <<"\n\nEnter the score"<<endl; cin>>grades; A+= if (score is 85++); A= if (score is 80++); B+= if (score is 75++); B= if (score is 70++); C+= if (score is 65++); C= if (score is 60++); D+= if (score is 55++); D= if (scrore is 50++); F9= if(score is 0+) cout<<"sccore in African studies is="<<as<<endl; cout<<"score in computer literacy is ="<<cl<<endl; cout<<"score in programming is="<<"prg""<<endl; cout<< "score in management is="<<m<<endl; cout<< "score in maths in ict is="<<mict<<endl; cout<< "score in descret maths is="<<dm<<endl; cout <<"score in comunication skills is="<<cs<<endly; cout<< "your scores are"<<grades; return 0; }

12th Apr 2019, 4:56 PM
Babayagiweh Gabriel
Babayagiweh Gabriel - avatar
2 ответов
+ 2
Ok so I'm not going to rewrite the entire code because your program has like 30+ errors mainly cause you probably didn't study the subject cause the syntax is very wrong. But anyway, here's the code to get the general idea about the correct syntax: #include <iostream> #include <iomanip> #include <cmath> using namespace ::std; int main() { int af, cl, prg, m, mict, dm, cs,grades[6]; double score; cout <<"\n\nEnter the score of 6 subjects"<<endl; for(int i =0;i<=5;i++) { cin >> grades[i]; score += grades[i]; } score = score/6; if (score>85) cout<<"A+"; else if (score>80) cout<<"A"; else if (score>75) cout<<"B+"; else if (score>70) cout<<"B"; else if (score>65) cout<<"C+"; else if (score>60) cout<<"C"; else if (score>55) cout<<"D+"; else if (score>=50) cout<<"D"; else if (score<50) cout<<"Fail"; return 0; }
12th Apr 2019, 6:12 PM
Animesh Singh
Animesh Singh - avatar
+ 2
Animesh Singh, Sorry, but please check your answer again, that code you give will trigger error too.
12th Apr 2019, 7:11 PM
Ipang