Create a function template named average

Assignment Help Basic Computer Science
Reference no: EM131396052

Complete the following tasks:

a. Create a function template named average(). It accepts two arguments of the same type and computes their arithmetic average. The average is returned as a double.

b. Overload the average()function to work correctly with three arguments.

c. Create a class named CollegeCourse with fields for the course ID (for example, ‘ENG 101'), your grade (for example, ‘A'), and the credits earned for the CollegeCourse (for example, 3). The CollegeCourse constructor accepts values for these fields as arguments, and calculates a fourth field named honorPoints. Calculate honorPoints as the product of the grade points (4 for an A, 3 for a B, 2 for a C, and 1 for a D) and the credits. Overload the + operator so that honor points for courses can be summed to create a summary CollegeCourse object. Overload the / operator so that a CollegeCourse object's honorPoints can be divided by an integer. Overload the

d. Write a main()function that declares several integers, doubles, and CollegeCourses, and demonstrates that both versions of average()work correctly with different arguments. Save the file as Averages.cpp.

e. Design a class of your choice where averaging objects makes sense. Include any necessary member functions so the class can be demonstrated using the average()template functions, and write a main()function that provides the demonstration. Save the file as Averages2.cpp.

Reference no: EM131396052

Questions Cloud

How are nonparametric tests different from parametric tests : Name the test that is the nonparametric relative of an independent-samples t test. Name the relative of a paired-samples t test.- How are nonparametric tests different from parametric tests?
Decide whether or not mobile computing iws synonymous : Decide whether or not mobile computing and wireless computing are synonymous. Provide at least two reasons to support your assertion and justify your response.
Analyze the errors with a mann whitney u test : Many studies show that noise affects cognitive functioning.- Analyze the errors with a Mann-Whitney U test and write a conclusion about the effects of noise on reading.
Significant benefits to the use of public transportation : After a recent study showed significant benefits to the use of public transportation, government officials have hired your consulting firm to increase the use of public transportation.  In the initial meeting between the government officials and y..
Create a function template named average : Design a class of your choice where averaging objects makes sense. Include any necessary member functions so the class can be demonstrated using the average()template functions, and write a main()function that provides the demonstration. Save the ..
Organization for economic co-operation and development : Every year in December, OECD celebrates International Anti-Corruption Day and its Initiative to Raise Global Awareness of Foreign Bribery.
Producer of calculators : You are a producer of calculators. In the market for calculators, two events happened simultaneously last month. There was a fire at your calculator factory that eliminated half of your firm's production capability. At the same time, your compens..
Determine whether you prefer a laptop or desktop : From the e-Activity, determine whether you prefer a laptop or desktop. Elaborate on the features that you would want your desktop or laptop to offer, and provide an explanation of why you would want such features.
Proper application of each step of each analysis : Calculus analysis and the Kantian analysis,step by step, and tell me the answer to which each analysis leads. You will be graded on the proper application of each step of each analysis, including the reasoning behind each.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Vulnerable to a future adea lawsuit

Could Palm Beach County be vulnerable to a future ADEA lawsuit using a "disparate impact" theory? If so, who would have the ultimate burden in such a case and what would the burden be? What critical Supreme Court rulings are relevant to these ques..

  Enhanced home utility auditing program

The user should be able to do the following: Export the data in the listing area to an external text file. Change default power ratings of a selected appliance.

  Command the obedience of followers

One classification of leaders is those who command the obedience of their followers. Others utilize their position to improve themselves, gaining enriching experiences, sometimes at the frustration of those they lead.

  Create a powerpoint presentation based on the scenario

Use each of the following features at least once in your presentation: clip art, media clip (animated graphic, movie, or sound), transition, and custom animation.

  What is the probability that this ball is red

For instance, if a blue ball is picked then it is replaced by a red ball and vice-versa. The process is repeated ten times and then a ball is picked from the box. What is the probability that this ball is red?

  What is the underlying premise that lowers its complexity

The complexity of the comparison-based sorting algorithms presented, on the average case, is O(n 2). Design a comparison-based sorting algorithm with a lower complexity. What is the underlying premise that lowers its complexity?

  Calculate the specific heat added to the cycle

Allowing a 5°C temperature difference between the external reservoirs and the air when appropriate, calculate the specific heat added to the cycle and its net specific work.

  The key desirable characteristics is robustness

Regardless of the operating system used, from MS-DOS to Macintosh OS X, from Windows to Linux, to OS/400, one of the key desirable characteristics is robustness of the operating system.

  Loop control variable is not modified by every iteration

1.Describe the three elements that must be included in order for a loop to perform correctly. What will happen if these statements are not included? Provide examples.

  Recursive function that returns the height of a binary tree

Assume that a given BST stores integer values in its nodes. Write a recursive function that sums the values of all nodes in the tree.

  Kinds of system-building methods used by dorfman

Recognize the kinds of system-building methods used by Dorfman to create its wireless warehouse system. Explain the methodologies you would recommend

  Create files as defined in the previous individual project

List the contents of the current directory. Create the directory structure and create the files as defined in the previous Individual Project.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd