Question: Please help!! The below code is not compiling, please fix it. I was using code::block to compile. /*************************************************** * This program demonstrates classes GradedActivity* *

Please help!! The below code is not compiling, please fix it. I was using code::block to compile.

/*************************************************** * This program demonstrates classes GradedActivity* * and Essay Class * ****************************************************/

/*************************************************** * Input : Set points for essay class * * Output : Display total points and grade of an essay* *******************************************************/

#ifndef GradedActivity_H #define GradedActivity_h

class GRADEDACTIVITY

{ //declaring required variables for the class protected: double score;

public: void setScore(double s) { score = s; }

double getScore() { reture score; } };

#ifndef ESSAY_H #define ESSAY_H #include #include "GradedActivity.h" using namespace std;

class Essay : public GradeActivity { protected: char letterGrade; //To hold the letter grade double grammar; //To hold score double spelling; //To hold score double correctLength; //To hold score double content; //To hold score double total;

public: Essay(double grammar, double spelling, double correctLength, double content) { Validation of 'grammer' points. do { if(grammar>30) { cout<<"Grammar<=30"<30); Validation of 'correctLength' points do { if(correctLength>20) { cout<<"CorrectLength<=20"<20); Validation of 'spelling' points. do { if(spelling>20) { cout<<"Spelling<=20"<20);

Validation of 'content' points

do { if(content>30) { cout<<"30); }

//setter methods to set points void setSpellingScore(double grammar) { this->grammar=grammar; } void setGrammarScore(double spelling) { this->spelling=spelling; } void setcorrectLengthScore(double correctLength) { this->content=content; }

//getter methods to get points double getGrammarScore() { return grammar; } double getSpellingScore() { return spelling; } double getCorrectlengthScore() { return correctLength; } double getContentscore() { return content; }

//method to get total points

double getTotal() { return total; }

//method to grade the points char getGrade() { if(total >= 90) letterGrade = 'A'; else if(score >= 80) letterGrade = 'B'; else if(score >= 70) letterGrade = 'C'; else if(score >= 60) letterGrade = 'D'; else letterGrade = 'F'; return letterGrade; } };

#endif ESSAY_H /* The libraries with console input and output facilities are available to program */

#include //include Essay header file #include "Essay.h" using namespace std;

/* main is a function with no parameters that returns an int value */

int main() { //create an object for Essay class Essay essay(30,20,20,20);

//print scores to the console cout<<"Grammar : "<

//print total points cout<<"Total Points:"<

//print grade of total points cout<<"Grade:"<

//pause the system console output system("pause"); return 0; }

Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!