final_project/Interface.cpp
// helper function for add_assignment and edit_assignment
// collects and assigns data for constructing or editing Grades

helper function for add_assignment and edit_assignment
collects and assigns data for constructing or editing Grades
helper function for add_assignment and edit_assignment collects and assigns data for constructing or editing Grades
void collect_grade_data(std::string& name, double& max_score, double& score){
        std::cout << "Enter new assignment name: ";
        std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
        getline(std::cin, name);
        std::cout << "Enter maximum possible score for assignment: ";
        max_score = get_stdin_value<double>();
        while (max_score < 0.0){
            std::cout << "Maximum score is less than zero. "
                << "Try again: ";
            max_score = get_stdin_value<double>();
        }
        std::cout << "Enter score earned on assignment: ";
        score = get_stdin_value<double>();
        while(score > max_score || score < 0.0){
            if (score > max_score){
                std::cout << "\nWarning: earned score is greater than maximum score!\n"
                    << "Be aware that using the \"fill perfects\" feature will "
                    << "set the score equal to maximum score.\n";
                break;
            }
            else if (score < 0.0){
                std::cout << "Earned score is less than zero. "
                    << "Try again: ";
                score = get_stdin_value<double>();
            }
        }
    }
void collect_grade_data ( std :: string & name , double & max_score , double & score ) { std :: cout << " " ; std :: cin . ignore ( std :: numeric_limits < std :: streamsize > :: max ( ) , ' \n ' ) ; getline ( std :: cin , name ) ; std :: cout << " " ; max_score = get_stdin_value < double > ( ) ; while ( max_score < 0.0 ) { std :: cout << " " << " " ; max_score = get_stdin_value < double > ( ) ; } std :: cout << " " ; score = get_stdin_value < double > ( ) ; while ( score > max_score || score < 0.0 ) { if ( score > max_score ) { std :: cout << " \n \n " << " \" \" " << " \n " ; break ; } else if ( score < 0.0 ) { std :: cout << " " << " " ; score = get_stdin_value < double > ( ) ; } } }
helper function for add_assignment and edit_assignment
collects and assigns data for constructing or editing Grades
helper function for add_assignment and edit_assignment collects and assigns data for constructing or editing Grades
//name = get_stdin_value<std::string>();
 /*while(score > max_score){
            std::cout << "Earned score is greater than maximum score. "
                << "Try again: ";
            score = get_stdin_value<double>();
        }*/