ComputingGrade.cpp
// The primary function of this entire program. This determines what entities to use or not, based on the user's input

The primary function of this entire program. This determines what entities to use or not, based on the user's input
The primary function of this entire program . This determines what entities to use or not based on the user ' s input
void computingSession::compute(){
    std::cout << "Is your class based on a total number of points attainable, w/ individual entities [i.e. homework, quizzes, etc.] being worth a certain number of points out of the total?";
    std::cout << std::endl << "Or is it based on a total attainable percentage of 100%, w/ individual entities being worth a certain percentage thereof?";
    std::cout << std::endl << "Please enter \"1\" for the 1st option, or \"2\" for the 2nd one: ";
    std::cin >> classSetup;
    checkSetupNum(std::cin, classSetup);
    std::cout << std::endl;
    float tempPointVal;
    if (classSetup == 1){
        std::cout << "How many possible points are attainable in this class?: ";
        std::cin >> totalPoints;
        checkPointVal(std::cin, totalPoints);
        std::cout << "What is the minimum total number of points necessary for an A?: ";
        std::cin >> tempPointVal;
        checkForLargerThanTotal(std::cin, tempPointVal);
        gradeThresholds.push_back(tempPointVal);
        std::cout << "Minimum total number of points necessary to obtain a B?: ";
        std::cin >> tempPointVal;
        checkForLargerThanTotal(std::cin, tempPointVal);
        while (tempPointVal >= gradeThresholds[0]){
            std::cin.clear();
            std::cin.ignore();
            std::cout << "Nah, try that again: ";
            std::cin >> tempPointVal;
            checkForLargerThanTotal(std::cin, tempPointVal);
        }
        gradeThresholds.push_back(tempPointVal);
        std::cout << "What about for a C?: ";
        std::cin >> tempPointVal;
        checkForLargerThanTotal(std::cin, tempPointVal);
        while (tempPointVal >= gradeThresholds[1]){
            std::cin.clear();
            std::cin.ignore();
            std::cout << "Try a smaller number: ";
            std::cin >> tempPointVal;
            checkForLargerThanTotal(std::cin, tempPointVal);
        }
        gradeThresholds.push_back(tempPointVal);
        std::cout << "Finally, enter the minimum point total needed for a D: ";
        std::cin >> tempPointVal;
        checkForLargerThanTotal(std::cin, tempPointVal);
        while (tempPointVal >= gradeThresholds[2]){
            std::cin.clear();
            std::cin.ignore();
            std::cout << "Too high, re-enter that: ";
            std::cin >> tempPointVal;
            checkForLargerThanTotal(std::cin, tempPointVal);
        }
        gradeThresholds.push_back(tempPointVal);
    }
    else {
        char stdThresholds;
        std::cout << "A common standard for professors to use is that 90% or more gets you an A, between 80% & 90% gets you a B, etc." << std::endl;
        std::cout << "If your class uses this standard, please just enter \"Y\"; otherwise, enter any other character: ";
        std::cin >> stdThresholds;
        while (!std::cin.good()){
            std::cin.clear();
            std::cin.ignore();
            std::cout << "I thought you knew what a character was... Nevermind, please just enter a letter, to keep it simple: ";
            std::cin >> stdThresholds;
        }
        if (stdThresholds == 'Y' || stdThresholds == 'y'){
            gradeThresholds.push_back(90); 
            gradeThresholds.push_back(80); 
            gradeThresholds.push_back(70); 
            gradeThresholds.push_back(60); 
        }
        else {
            std::cout << "Please enter the minimum overall percentage necessary to obtain an A: ";
            std::cin >> tempPointVal;
            checkGradeVal(std::cin, tempPointVal);
            gradeThresholds.push_back(tempPointVal);
            std::cout << "Now enter the minimum necessary percentage necessary to get a B: ";
            std::cin >> tempPointVal;
            checkGradeVal(std::cin, tempPointVal);
            while (tempPointVal >= gradeThresholds[0]){
                std::cin.clear();
                std::cin.ignore();
                std::cout << "Nah, that's too high. Re-enter that: ";
                std::cin >> tempPointVal;
                checkGradeVal(std::cin, tempPointVal);
            }
            gradeThresholds.push_back(tempPointVal);
            std::cout << "What's the least you'll need for a C?: ";
            std::cin >> tempPointVal;
            checkGradeVal(std::cin, tempPointVal);
            while (tempPointVal >= gradeThresholds[1]){
                std::cin.clear();
                std::cin.ignore();
                std::cout << "Nah, that's too high. Re-enter that: ";
                std::cin >> tempPointVal;
                checkGradeVal(std::cin, tempPointVal);
            }
            gradeThresholds.push_back(tempPointVal);
            std::cout << "Finally, put in the minimum you need to get to get a D: ";
            std::cin >> tempPointVal;
            checkGradeVal(std::cin, tempPointVal);
            while (tempPointVal >= gradeThresholds[2]){
                std::cin.clear();
                std::cin.ignore();
                std::cout << "How about...No? Try again: ";
                std::cin >> tempPointVal;
                checkGradeVal(std::cin, tempPointVal);
            }
            gradeThresholds.push_back(tempPointVal);
        }
    }
    std::cout << "Does homework count towards your final grade? If so, enter \"Y\"; otherwise, enter \"N\": ";
    std::cin >> doesItCount[0];
    checkLetterEntry(doesItCount[0]);
    if (doesItCount[0] == 'Y' || doesItCount[0] == 'y')
        homeworkEntity();
    std::cout << "Alright, so do quizzes count towards your final grade? If so, enter \"Y\"; otherwise, enter \"N\": ";
    std::cin >> doesItCount[1];
    checkLetterEntry(doesItCount[1]);
    if (doesItCount[1] == 'Y' || doesItCount[1] == 'y')
        quizEntity();
    std::cout << "Did you have any exams that counted towards your final grade? If so, enter \"Y\"; otherwise, enter \"N\": ";
    std::cin >> doesItCount[2];
    checkLetterEntry(doesItCount[2]);
    if (doesItCount[2] == 'Y' || doesItCount[2] == 'y')
        examEntity();
    std::cout << "Is there a final exam? Please enter \"Y\" or \"N\" (regardless of whether you've taken it yet): ";
    std::cin >> doesItCount[3];
    checkLetterEntry(doesItCount[3]);
    if (doesItCount[3] == 'Y' || doesItCount[3] == 'y')
        finalEntity();
    std::cout << "Is there anything else that counts towards your final grade? Please enter \"Y\" or \"N\": ";
    std::cin >> doesItCount[4];
    checkLetterEntry(doesItCount[4]);
    if (doesItCount[4] == 'Y' || doesItCount[4] == 'y')
        miscEntity();
    resultsDisplay();
}
void computingSession :: compute ( ) { std :: cout << " " ; std :: cout << std :: endl << " " ; std :: cout << std :: endl << " \" \" \" \" " ; std :: cin >> classSetup ; checkSetupNum ( std :: cin , classSetup ) ; std :: cout << std :: endl ; float tempPointVal ; if ( classSetup == 1 ) { std :: cout << " " ; std :: cin >> totalPoints ; checkPointVal ( std :: cin , totalPoints ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkForLargerThanTotal ( std :: cin , tempPointVal ) ; gradeThresholds . push_back ( tempPointVal ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkForLargerThanTotal ( std :: cin , tempPointVal ) ; while ( tempPointVal >= gradeThresholds [ 0 ] ) { std :: cin . clear ( ) ; std :: cin . ignore ( ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkForLargerThanTotal ( std :: cin , tempPointVal ) ; } gradeThresholds . push_back ( tempPointVal ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkForLargerThanTotal ( std :: cin , tempPointVal ) ; while ( tempPointVal >= gradeThresholds [ 1 ] ) { std :: cin . clear ( ) ; std :: cin . ignore ( ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkForLargerThanTotal ( std :: cin , tempPointVal ) ; } gradeThresholds . push_back ( tempPointVal ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkForLargerThanTotal ( std :: cin , tempPointVal ) ; while ( tempPointVal >= gradeThresholds [ 2 ] ) { std :: cin . clear ( ) ; std :: cin . ignore ( ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkForLargerThanTotal ( std :: cin , tempPointVal ) ; } gradeThresholds . push_back ( tempPointVal ) ; } else { char stdThresholds ; std :: cout << " " << std :: endl ; std :: cout << " \" \" " ; std :: cin >> stdThresholds ; while ( ! std :: cin . good ( ) ) { std :: cin . clear ( ) ; std :: cin . ignore ( ) ; std :: cout << " " ; std :: cin >> stdThresholds ; } if ( stdThresholds == ' ' || stdThresholds == ' ' ) { gradeThresholds . push_back ( 90 ) ; gradeThresholds . push_back ( 80 ) ; gradeThresholds . push_back ( 70 ) ; gradeThresholds . push_back ( 60 ) ; } else { std :: cout << " " ; std :: cin >> tempPointVal ; checkGradeVal ( std :: cin , tempPointVal ) ; gradeThresholds . push_back ( tempPointVal ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkGradeVal ( std :: cin , tempPointVal ) ; while ( tempPointVal >= gradeThresholds [ 0 ] ) { std :: cin . clear ( ) ; std :: cin . ignore ( ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkGradeVal ( std :: cin , tempPointVal ) ; } gradeThresholds . push_back ( tempPointVal ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkGradeVal ( std :: cin , tempPointVal ) ; while ( tempPointVal >= gradeThresholds [ 1 ] ) { std :: cin . clear ( ) ; std :: cin . ignore ( ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkGradeVal ( std :: cin , tempPointVal ) ; } gradeThresholds . push_back ( tempPointVal ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkGradeVal ( std :: cin , tempPointVal ) ; while ( tempPointVal >= gradeThresholds [ 2 ] ) { std :: cin . clear ( ) ; std :: cin . ignore ( ) ; std :: cout << " " ; std :: cin >> tempPointVal ; checkGradeVal ( std :: cin , tempPointVal ) ; } gradeThresholds . push_back ( tempPointVal ) ; } } std :: cout << " \" \" \" \" " ; std :: cin >> doesItCount [ 0 ] ; checkLetterEntry ( doesItCount [ 0 ] ) ; if ( doesItCount [ 0 ] == ' ' || doesItCount [ 0 ] == ' ' ) homeworkEntity ( ) ; std :: cout << " \" \" \" \" " ; std :: cin >> doesItCount [ 1 ] ; checkLetterEntry ( doesItCount [ 1 ] ) ; if ( doesItCount [ 1 ] == ' ' || doesItCount [ 1 ] == ' ' ) quizEntity ( ) ; std :: cout << " \" \" \" \" " ; std :: cin >> doesItCount [ 2 ] ; checkLetterEntry ( doesItCount [ 2 ] ) ; if ( doesItCount [ 2 ] == ' ' || doesItCount [ 2 ] == ' ' ) examEntity ( ) ; std :: cout << " \" \" \" \" " ; std :: cin >> doesItCount [ 3 ] ; checkLetterEntry ( doesItCount [ 3 ] ) ; if ( doesItCount [ 3 ] == ' ' || doesItCount [ 3 ] == ' ' ) finalEntity ( ) ; std :: cout << " \" \" \" \" " ; std :: cin >> doesItCount [ 4 ] ; checkLetterEntry ( doesItCount [ 4 ] ) ; if ( doesItCount [ 4 ] == ' ' || doesItCount [ 4 ] == ' ' ) miscEntity ( ) ; resultsDisplay ( ) ; }
The primary function of this entire program.
The primary function of this entire program .
// Determining the grading setup of the class
 // Finished testing input
 // Inquire into how many possible points, as well as the grade thresholds
 // A
 // B
 // C
 // D
 // Compute: Homework
 // Compute: Quizzes
 // Compute: Exams
 // Compute: Final Exam
 // Compute: Misc. Entities
 /*
    float finGrade;

    finGrade = g[0].getGradeFN() + g[1].getGradeFN() + g[2].getGradeFN() + g[3].getGradeFN() + g[4].getGradeFN();
    */ // Output results via this function:
