Using C++, I have to design a class named TermPaper that holds an author's name, the subject of the paper, and an assigned letter grade. Include methods to set the values for each data field and display the values for each data field. The instructor provided a TermPaper.h and TermPaper.cpp file but I am having a problem creating the source code. I am unsure where to declare the vairables....here's what I have and it's not compiling. #include #include "TermPaper.cpp" #include "Termpaper.h" using namespace std; int main() { TermPaper(); cout<< "Please enter first name. "; cin>>firstName; cout<< "Please enter last name. "; cin>>lastName; cout<< "Please enter subject. "; cin>>subject; cout<< "Please enter letter grade. "; cin>>grade; cout<< "First Name: " <
Using C++, I have to design a class named TermPaper that holds an author's name, the subject of the paper, and an assigned letter grade. Include methods to set the values for each data field and display the values for each data field. The instructor provided a TermPaper.h and TermPaper.cpp file but I am having a problem creating the source code. I am unsure where to declare the vairables....here's what I have and it's not compiling.
#include <iostream>
#include "TermPaper.cpp"
#include "Termpaper.h"
using namespace std;
int main()
{
TermPaper();
cout<< "Please enter first name. ";
cin>>firstName;
cout<< "Please enter last name. ";
cin>>lastName;
cout<< "Please enter subject. ";
cin>>subject;
cout<< "Please enter letter grade. ";
cin>>grade;
cout<< "First Name: " <<paper1.getFName();endl
cout<< "Last Name: " <<paper1.getLName();endl
cout<< "Subject: " <<paper1.getSubject();endl
cout<< "Grade: " <<paper1.getLetterGrade();
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images