Computers and Technology

Design an Essay class that is derived from the GradedActivity class presented in this chapter. The Essay class should determine the grade a student receives for an essay. The student's essay score be up tp 100 and is determined in the following manner: Grammer: 30 points Spelling: 20 points Correct length: 20 points Content: 30 points Demonstrate the class in a simple program. use virtual functions, use seperate headers and class files but zip them.

this is my .cpp file

#include "GradedActivity. h"

//

// Member function GradedActivity::getLetterGrade *

//

char GradedActivity::getLetterGrade() const

{

char letterGrade; // To hold the letter grade

if (score > 89)letterGrade = 'A';

else if (score > 79) letterGrade = 'B';

else if (score > 69) letterGrade = 'C';

else if (score > 59) letterGrade = 'D';

else letterGrade = 'F';

return letterGrade;

}

this is the .H file

#ifndef GRADEDACTIVITY_H

#define GRADEDACTIVITY_H

// GradedActivity class declaration

class GradedActivity

{

protected:

double score; // To hold the numeric score

public:

// Default constructor

GradedActivity()

{ score = 0.0; }

// Constructor

GradedActivity(double s)

{ score = s; }

// Mutator function

void setScore(double s)

{ score = s; }

// Accessor functions

virtual double getScore() const

{ return score; }

virtual char getLetterGrade() const;

};

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:30, gerardoblk5931
An atom's diameter is about 0.1 nanometer (1×10-9m), and a human hair is about 1×10-3m. how many times greater is a human hair than an atom's diameter? sorry pushed wronf button but this is math
Answers: 3
image
Computers and Technology, 23.06.2019 02:00, kelseybell5522
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
image
Computers and Technology, 23.06.2019 12:00, muncyemily
From excel to powerpoint, you can copy and paste a. cell ranges and charts, one at a time. b. cell ranges and charts, simultaneously. c. charts only. d. cell ranges only.
Answers: 3
image
Computers and Technology, 23.06.2019 12:50, tommy4260
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
Do you know the correct answer?
Design an Essay class that is derived from the GradedActivity class presented in this chapter. The E...

Questions in other subjects:

Konu
English, 05.03.2021 06:10