Explore BrainMass

Explore BrainMass

    C++ Program

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Create a class called CollegeCourse with

    Functions:

    1. Average()- a function template that will accept two arguments(HonorPoints of the same data type) and computes the average of two HonorPoints

    a. The HonorPoints = grade points (4 for an A, 3 for a B, 2 for a C, and 1 for a D) multiplied with the credits

    2. Average() - overload the above function to accept three arguments

    3. +operator() - overload this function so that honor points for courses can be summed.

    4. /operator() -overload this function so that if the honorPoints are divided by an integer; this function should return a double.

    5. <<operator()- overload this function to display the details of a CollegeCourse (such as the

    Main:

    1. main() program that declares several integers, doubles, and CollegeCourse objects. No user input. Just store your input for the credits, course ID, letter grade into your CollegeCourse object.
    Instantiate your CollegeCourse objects by creating an array of objects.

    2. Demonstrate that both versions of average() work correctly with integers, doubles, and CollegeCourse objects, +operator() and /operator() to compute the average honorPoints for the CollegeCourses

    3. Display: Examples for CollegeCourse objects (filled via your array of objects) for 2 and for 3 Course Objects.

    ENG101 Grade: A Credits: 3 Honor points: 12
    PSY251 Grade: B Credits: 3 Honor points: 9
    HIS301 Grade: D Credits: 4 Honor points: 4
    Average: 8.33333

    ENG101 Grade: A Credits: 3 Honor points: 12
    PSY251 Grade: B Credits: 3 Honor points: 9
    Average:10.5

    © BrainMass Inc. brainmass.com December 15, 2022, 7:56 pm ad1c9bdddf
    https://brainmass.com/computer-science/cpp/c-program-261341

    Solution Summary

    This posting contains answers to the given questions.

    $2.49

    ADVERTISEMENT