I've just started learning C++ so I am at the basics. Can anyone help me with my code? It's an excercise from my book and I can't seem to get it to do what I want. The calculategrade function has to return the char grade to main and then display. I can't figure out where I'm going wrong.
Code:#include<iostream> using namespace std; void getScore(int &score); calculateGrade(int score); int main() { float grade; int courseScore; cout<<"Line 1: Based on the course score, this program " <<"computes the course grade."<<endl; getScore(courseScore); calculateGrade(courseScore); cout<<"Line 7: Your grade for the course is: "<<grade<<endl; return 0; } void getScore(int &score) { cout<<"Line 4: Enter course score-> "; cin>>score; cout<<endl<<"Line 6: Course score is: "<<score<<endl; } calculateGrade(int score) { float grade; if(score >= 90) grade = static_cast<char>('65'); else if(score >= 80) grade = static_cast<char>('66'); else if(score >= 70) grade = static_cast<char>('67'); else if(score >= 60) grade = static_cast<char>('68'); else grade = static_cast<char>('70'); return(grade); }