A C++ assignment  Implement the GradedActivity class.  Copying from the pdfs is fine. Create a new class Assignment which is derived from GradedActivity.  It should have three private member ints for 3 different parts of an assignment score: functionality (max 50 points), efficiency (max 25 points), and style (max 25 points).  Create member function set() in Assignment which takes three parameter ints and sets the member variables.  It should also set its score member, which is inherited from GradedActivity, using the setScore() function, to functionality + efficiency + style.  Signature: void Assignment::set(int, int, int) Create a main program which instantiates an Assignment, asks the user for its functionality, efficiency, and style scores, and prints out the score and letter grade for the assignment.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

A C++ assignment 

  • Implement the GradedActivity class.  Copying from the pdfs is fine.
  • Create a new class Assignment which is derived from GradedActivity.  It should have three private member ints for 3 different parts of an assignment score: functionality (max 50 points), efficiency (max 25 points), and style (max 25 points). 
  • Create member function set() in Assignment which takes three parameter ints and sets the member variables.  It should also set its score member, which is inherited from GradedActivity, using the setScore() function, to functionality + efficiency + style.  Signature:

void Assignment::set(int, int, int)

  • Create a main program which instantiates an Assignment, asks the user for its functionality, efficiency, and style scores, and prints out the score and letter grade for the assignment.

___________________________________________________

Examples from the pdfs

 

d PassFailExam::set(int q, int m, int p) { double numericScore, pointsEach;

numQuestions = q;
numMissed = m;
numToPass = p;
pointsEach = 100.0 / numQuestions;
numericScore = 100.0 - (numMissed * pointsEach);

setScore(numericScore); char PassFailExam::getLetterGrade() const {

if ((numQuestions - numMissed) >= numToPass) return 'P';

else return 'F';

}

 

___________________________________________________

 

 

 

 

class PassFailExam : public GradedActivit { private: int numQuestions; int numMissed; int numToPass; public: PassFailExam()

{ numQuestions = 0; numMissed = 0; numToPass = 0; }

void set(int, int, int); char getLetterGrade() const;

};

 

___________________________________________________

 

class GradedActivity { protected: double score; public: GradedActivity()

{ score = 0.0; } GradedActivity(double s)

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

{ score = s; } double getScore()

{ return score; } char getLetterGrade() const;
 
};
 
___________________________________________________
 
PassFailExam quiz;

quiz.set(10,2,8);
cout << "The score on quiz is: ";
cout << quiz.getScore() << endl;
cout << "The letter grade is: ";
cout << quiz.getLetterGrade() << endl;

 

 

____________________________________________________________________________________________________________________________________________________________________________________________________________

Polymorphism Chapter: 

 

 

class PassFailExam : public GradedActivity

{
private:

int numQuestions; int numMissed; int numToPass; public: PassFailExam()

{ numQuestions = 0; numMissed = 0; numToPass = 0; }

void set(int, int, int); char getLetterGrade() const;
 
};
 
 
 
___________________________________________________

 

int main()

{ GradedActivity HW1; PassFailExam quiz; GradedActivity *gaPtr;

HW1.setScore(80); quiz.set(10,2,8);

gaPtr = &HW1;

cout << "HW1 grade: " << gaPtr->getLetterGrade() << endl;

gaPtr = &quiz;

cout << "quiz grade: " << gaPtr->getLetterGrade() << endl; }

 

___________________________________________________

 

class GradedActivity { private: double score; public: GradedActivity()

{ score = 0.0; } GradedActivity(double s)

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

{ score = s; } double getScore()

{ return score; }
 
char getLetterGrade() const; 
};
 
 
___________________________________________________

int main()

{ GradedActivity HW1; PassFailExam quiz; GradedActivity *gaPtr;

HW1.setScore(80); quiz.set(10,2,8);

___________________________________________________

int main()

{ GradedActivity HW1;
PassFailExam quiz;
GradedActivity *gaPtr;

HW1.setScore(80);

quiz.set(10,2,8);

gaPtr = &HW1;

cout << "HW1 grade: " << gaPtr->getLetterGrade() << endl;

gaPtr = &quiz;

cout << "quiz grade: " << gaPtr->getLetterGrade() << endl;

 

___________________________________________________

class GradedActivity { private: double score; public: GradedActivity()

{ score = 0.0; } GradedActivity(double s)

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

{ score = s; } double getScore()

 

{ return score; }
virtual char getLetterGrade() const;

};

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education