0
Writing a program to calculate the grade score of a student
I need help
5 ответов
+ 1
You'd need to give more information.
+ 1
I didn't know exactly what you were trying to achieve, but I've fixed all bugs, and made some guesses:
https://code.sololearn.com/cu4YLJze6TWp/#cpp
You will have to let me know if that is correct.
Any questions, feel free to ask.
0
#include <iostream>
using namespace std;
char Subject[100];
double Result;
char unicalResult(double CA, double ExamScore );
int main();
{
int marks;
double CA=0.0;
double ExamScore=0.0;
cout<<"Computer Science continous assessment: "<<end1;
cin>>CA;
cout<<"____________________";
cout<<"Enter subject "<<end1;
cin>>CSC181;
cout<<"Enter Exam Score: "<<end1;
cin>>40;
cout<<"Subject: "<<subject<<end1;
cout<<"Continous assessment: "<<CA<<end1;
cout<<"Your Unical Result is: "<<unicalResult(CA, ExamScore)<<end1;
}
char unicalResult(double CA, double ExamScore)
{
Result=CA+ExamScore;
char Grade;
if(Result<=39.9)
{
Grade="F";
}
else(Result<=44.9)
{
Grade="E";
}
else(Result<=49.9)
{
Grade="D";
}
else(Result<=59.9)
{
Grade="C";
}
else(Result<=69.9)
{
Grade="B";
}
else(CA>=70.0)
{
Grade="A";
}
return result;
}
0
help me debug
0
When you write cin >> CSC181 and cin>>40..."40" and "csc" are undeclared variables. That is to say that 40 is the name of your variable and not the value of it