For C++ Write program with inheritance based on the \'example program\'. Change
ID: 3578722 • Letter: F
Question
For C++ Write program with inheritance based on the 'example program'. Change the 'FinalExam.cpp' function and the related files. Step 1: Rewrite the function 'void FinalExam::set(int questions, int missed)', to be as the followings. void FinalExam::set(int effort, double luck) In the above function, effort is an integer between 0 to 100, representing the actual effort the student makes for the exam. Luck is a double type, between 0 to 2, representing the luck factor for the exam. Use the function as the followings to calculate the numeric score. numericScore = effort * luck; Step 2: Change the related files, such as FinalExam.h and the the file with the main() function for user input. Step 3: Make sure the final program asks the user to enter his or her 'effort' and 'luck', and displays the numeric score as well as the grade letter. What is your effort for the final exam? 90 What is your luck for the final exam? 1.1 The exam score is 99 The exam grade is A Press any key to continue.. .Explanation / Answer
void FinalExam::set(int effort, double luck){
double numericScore = effort * luck;
}
int main(){
int effort;
double luck;
cout<<"What is your effort for the final exam? ";
cin>>effort;
cout<<" What is your luck for the final exam? ";
cin>>luck;
double score = set(effort, luck);
cout<<"The exam score is "<<score<<endl;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.