Purchase Solution

C++ Program

Not what you're looking for?

Ask Custom Question

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

Purchase this Solution

Solution Summary

This posting contains answers to the given questions.

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

C# variables and classes

This quiz contains questions about C# classes and variables.