

this is the essay.h file
this is the gradedActivity.h
file
this is the gradeActivity.cpp
file
Can someone help me write the
code for this in c++. I'm really struggling with this. If you can
include comments and a screenshot of the test run it would be
greatly appreciated
Note : code in bold is implemented as asked in the question
-------------------------------------
// Implementation file for the GradedActivity class
#include "GradedActivity.h"
//******************************************************
// Member function GradedActivity::determineGrade *
//******************************************************
char GradedActivity::getLetterGrade() const
{
char letterGrade;
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;
}
----------
demo
------------------------
#include <iostream>
#include "Essay.h"
using namespace std;
int main()
{
Essay essay;
double contentPoints;
double spellingPoints;
double lengthPoints;
double grammerPoints;
cout<<"Please give content points(Max 30): ";
cin>>contentPoints;
cout<<"Please give spelling points(Max 20): ";
cin>>spellingPoints;
cout<<"Please give length points(Max 20): ";
cin>>lengthPoints;
cout<<"Please give grammer points(Max 30): ";
cin>>grammerPoints;
essay.setContentPoints(contentPoints);
essay.setGrammerPoints(grammerPoints);
essay.setLengthPoints(lengthPoints);
essay.setSpellingPoints(spellingPoints);
cout<<"Your grade is:"<<essay.getLetterGrade()<<endl;
system("PAUSE");
return 0;
}
------------
graded.h
// Specification file for the GradedActivity class
#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; }
GradedActivity(double s)
{ score = s; }
// Mutator function
void setScore(double s)
{ score = s;}
// Accessor functions
double getScore() const
{ return score; }
char getLetterGrade() const;
};
#endif
---------
essay.h
---------
#ifndef ESSAY_H
#define ESSAY_H
#include "GradedActivity.h"
class Essay: public GradedActivity
{
private:
double grammerPoints;
double spellingPoints;
double lengthPoints;
double contentPoints;
public:
Essay(){
grammerPoints=0.0;
spellingPoints=0.0;
lengthPoints=0.0;
contentPoints=0.0;
}
void setGrammerPoints(double);
void setSpellingPoints(double);
void setLengthPoints(double);
void setContentPoints(double);
double getGrammerPoints()const {return grammerPoints;}
double getSpellingPoints()const {return spellingPoints;}
double getLengthPoints()const {return lengthPoints;}
double getContentPoints()const {return contentPoints;}
virtual char getLetterGrade();
};
#endif
-----------
essay.cpp
// Implementation file for the GradedActivity class
#include "essay.h"
//Implementing mutator functions
void Essay::setGrammerPoints(double points){
grammerPoints=points;
}
void Essay::setSpellingPoints(double points){
spellingPoints=points;
}
void Essay::setLengthPoints(double points){
lengthPoints=points;
}
void Essay::setContentPoints(double points){
contentPoints=points;
}
// implementing getLetterGrade() vitual function.
//This function needs to be modified as will be explained in your class.
// We have implemented this as it should be
//comment if you need upgradation and provide material for this function
char Essay::getLetterGrade(){
char letterGrade;
int score=grammerPoints+spellingPoints+lengthPoints+contentPoints;
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;
}
---------
output :

Please give content points (Max 30: 25 Please give spelling points (Max 20): 15 Please give length points (Max 20) 15 lease give grammer points (Max 3): 25 Your grade is:B Press any key to continue . . .
this is the essay.h file this is the gradedActivity.h file this is the gradeActivity.cpp file Can...
C++ Lab 9B Inheritance Class Production Worker Create a project C2010Lab9b; add a source file Lab9b.cpp to the project. Copy and paste the code is listed below: Next, write a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have member variables to hold the following information: Shift (an integer) Hourly pay rate (a double) // Specification file for the ProductionWorker Class #ifndef PRODUCTION_WORKER_H #define PRODUCTION_WORKER_H #include "Employee.h" #include <string> using namespace std; class ProductionWorker...
Design an Essay class that extends the GradedActivity class presented in the chapter 10 of textbook. The Essay class should determine the grade a student receives for an essay. The student’s essay score can be up to 100 and is determined in the following manner: Grammar: 30 points Spelling: 20 points Correct length: 20 points Content: 30 points Demonstrate the class in a simple program. Example Run run: Term paper: Grammar points: 25.0 Spelling points: 18.0...
This one is a little tricky for me. Please put the following pseudocode into C++. Below the pseudocode is a header file as well as a cpp file that needs to be included. // Start // Declarations // TermPaper paper1 // string firstName // string lastName // string subject // character grade // output "Please enter first name. " // input firstName // output "Please enter last name. " // input lastName // output "Please enter subject. " // input...
Define a class in C++ called gradebook that can implement the following. The main will be calling this to pass in two different gradebooks. class Gradebook { public: // default constructor Gradebook(); // return the size of the current vector: scores, // which represents current gradebook int getSize() const; // insert a FinalGrade object, newFG, // into the end of the current gradebook void insert(FinalGrade newFG); // return a FinalGrade object, // which holds the maximum score in the current...
please write the code in
C++
2 Base class File 3 Derived class PDF 3.1 Class declaration • The class PDF inherits from File and is a non-abstract class 1. Hence objects of the class PDF can be instantiated. 2. To do so, we must override the pure virtual function clone) in the base class • The class declaration is given below. • The complete class declaration is given below, copy and paste it into your file. . It is...
I need help implementing class string functions, any help would be appreciated, also any comments throughout would also be extremely helpful. Time.cpp file - #include "Time.h" #include <new> #include <string> #include <iostream> // The class name is Time. This defines a class for keeping time in hours, minutes, and AM/PM indicator. // You should create 3 private member variables for this class. An integer variable for the hours, // an integer variable for the minutes, and a char variable for...
Design a class Complex for handling Complex numbers and include the following: _ real: a double _ imaginary: a double The class has the following member functions. a. A constructor initializing the number with default parameters. b. Getters and Setters of the class data members as given below _ void setReal(double r) _ double getReal()const _ void setImaginary(double i) _ double getImaginary() const d. Overload unary ! operator which returns true if the real and the imaginary parts are zero,...
/* FILE: ./shapes7/shape.h */
#include <iostream>
using std::ostream;
class shape{
int x,y;
public:
shape( )
{ x=y=0;}
shape(int xvalue, int yvalue);
void setShape(int new_x, int new_y);
void setX(int new_x);
void setY(int new_y);
int getX( ) const;
int getY( ) const;
virtual void move(int x, int y) = 0;
virtual void shift(int dx, int dy) = 0;
virtual void draw( ) = 0;
virtual void rotate(double r) = 0;
virtual void print(ostream&)const;
friend ostream & operator<<(ostream & os, const shape& s);...
Today assignment , find the errors in this code and fixed them. Please I need help with find the errors and how ro fixed them. #include <iostream> #include <cstring> #include <iomanip> using namespace std; const int MAX_CHAR = 100; const int MIN_A = 90; const int MIN_B = 80; const int MIN_C = 70; double getAvg(); char determineGrade(double); void printMsg(char grade); int main() { double score; char grade; char msg[MAX_CHAR]; strcpy(msg, "Excellent!"); strcpy(msg, "Good job!"); strcpy(msg, "You've passed!"); strcpy(msg, "Need...