Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Explain each step of how this C + + code below executes. - - - - - - - - - - - - -
Explain each step of how this C code below executes.
GradeCalculator.h
#ifndef GRADECALCULATOR
#define GRADECALCULATOR
#include
#include
class GradeCalculator
private:
std::map gradeMap;
double totalPoints;
int numClasses;
char minGrade;
char maxGrade;
double gpa;
public:
GradeCalculator;
void collectGrades;
void calculateResults;
void displayResults;
;
#endif
GradeCalculator.cpp
#include "GradeCalculator.h
#include
GradeCalculator::GradeCalculator : totalPoints numClasses minGradeA maxGradeC gpa
gradeMap ABC;
void GradeCalculator::collectGrades
std::string score;
std::cout "How many scores are you going to enter: numClasses std::endl;
for int i ; i numClasses; i
std::cout "What is class i score: ;
std::cin score;
char grade score;
totalPoints gradeMapgrade;
if grade minGrade
minGrade grade;
if grade maxGrade
maxGrade grade;
void GradeCalculator::calculateResults
gpa totalPoints numClasses;
void GradeCalculator::displayResults
std::cout "Minimum: minGrade std::endl;
std::cout "Maximum: maxGrade std::endl;
std::cout "Your GPA is: gpa std::endl;
Source.cpp
#include
#include "GradeCalculator.h
int main
GradeCalculator gc;
gccollectGrades;
gccalculateResults;
gcdisplayResults;
return ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started