this is the question
Most teachers assign various graded activities for their students to complete. A graded activity can consist of a numeric score such as 65, 89, 93 and so on. GradedActivity class is to hold the numeric score and letter grade of a graded activity. When a numeric score is stored by a class, it automatically determines the letter grade. The class has a default constructor that initializes the score which is a private member variable to 0.0. A second constructor accepts an argument for score. The setscore member function also accepts an argument for the score variable, and the getLetterGrade member function returns the letter that corresponds to the value in score.
finalExam class is derived from the gradedActivity class. It has member variables for the number of question on the exam (numQuest), the number of points each question is worth (pointEach) and the number of question missed by the student (numMissed). The default constructor assigns 0 to each of the class’s member variables. Another constructor accepts two arguments, one for the number questions on the exam and one for the number of questions missed. This constructor merely passes those values as arguments to set which is the class member function. In set function, identify, numQuest and numMissed will be set with those values respectively. Assume that the full mark test is 100 points. The numeric test score is calculated by reducing the full mark with the total marks for the missed questions. Set the numeric test score into score.
Demonstrate the two classes in a main function. So that the following sample output might be produced:
How many questions are on the final exam? 20 [enter]
How many questions did the student miss? 3 [enter]


i've tried n now im so stucked. please help me

Recommended Answers

All 3 Replies

Please boil your question down to a 20 line, compilable piece of code that we can help you with. If you don't want to do your homework, why would we??

Dave

here is the code

grade.h

#include<iostream>
using namespace std;

      class gradedActivity
      {
       public:
              gradedActivity();
              gradedActivity(double thescore,char thegrade);
              void setscore(double newscore);
              void setgrade(char newgrade);
              char getLettergrade();
              double getsetscore();
              
         
        
        
       private:
               double score;
             char grade;
                      
};

gradedActivity::gradedActivity(): score(),grade()
     {
     }
     
     gradedActivity::gradedActivity(double thescore,char thegrade):score(10), grade()
     {
     }
    double gradedActivity::getsetscore()
     {
       return score;
       }
     char gradedActivity::getLettergrade()
     {
       if (score >=90)
        grade='A'; 
        else if(score>=80)
        grade='B';
        else if(score>=70)
        grade='C';
        else if(score>=60)
        grade='D';
        else
        grade='F';
                                    
       return grade;                                                                                               
       }
     
     void gradedActivity::setscore(double newscore)
     {
          score=newscore;
     }
     
     void gradedActivity::setgrade(char newgrade)
     { 
          grade=newgrade;
     
     }

grade.cpp

#include<iostream>
#include<cstdlib>
#include "grade.h"
using std::cout;


 gradedActivity::gradedActivity(): score(),grade()
     {
     }
     
     gradedActivity::gradedActivity(double thescore,char thegrade):score(10), grade()
     {
     }
    double gradedActivity::getsetscore()
     {
       return score;
       }
     char gradedActivity::getLettergrade()
     {
       if (score >=90)
        grade='A'; 
        else if(score>=80)
        grade='B';
        else if(score>=70)
        grade='C';
        else if(score>=60)
        grade='D';
        else
        grade='F';
                                    
       return grade;                                                                                               
       }
     
     void gradedActivity::setscore(double newscore)
     {
          score=newscore;
     }
     
     void gradedActivity::setgrade(char newgrade)
     { 
          grade=newgrade;
     
     }  
   void gradedActivity:: checkprint()     
     {
     cout <<"enter a numeric test score";
     cin >>score;
     
     cout<<"the grade for the test";
     cout << grade ;                 
     exit(1);                              
     }

i only got this,n now im stucked

uh huh... As far as you've posted, you've got nothing in your code... try a little bit harder, take some code snippets as a reference, google some tutorials, and come back when you've got a real CODE issue, ok?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.