In C++ language with comments In this task, you'll be writing a program that calculates the average
Fantastic news! We've Found the answer you've been seeking!
Question:
In C++ language with comments
Transcribed Image Text:
In this task, you'll be writing a program that calculates the average percentage of students given their percentages for their individual courses, and identifies which student has the higher average percentage (assume the percentages won't ever be equal). The students will be modelled as instances of the class named marksBreakdown. The class has the following member variables and functions: • Member Variables (all private): o An integer variable named "cs200" o An integer variable named "cs210" o An integer variable named "cs225" o A double variable named "average" • Member Functions (all public): o Default Constructor: Set the value for all member variables to zero o Parameterized Constructor: Used to set the values for cs200, cs210, cs225 only o Setters: Used to set the values of every member variable ■setCS200, setCS210, setCS225, setAverage o o Getters: Used to get the value of every member variable ■getCS200, getCS210, getCS225, getAverage printResult: This function prints out the marks for CS200, CS210, CS225 and the average percentage of a student (according to the sample output) Note: You can ONLY access the values of cs200, es210, and cs225 directly when you're taking their input from the user in main(), after which you'll have to assign them to their respective member variables using the setter functions. Once they're assigned, you MUST use the getter functions to access their values throughout your code. In main(), take the user's input for the marks of 2 students (make sure they're between o and 100), and create 2 instances of marksBreakdown to represent the 2 students. Initialize one student using the setter functions, and the other student using the parameterized constructor. Next, use the setAverage setter to calculate the average percentage (assume every course has equal credit hours) of each student (you're not allowed to pass the marks from main()). Once the average percentage for both students have been computed and assigned to the average member variable, compare both students' average percentage in main(), and print it out with the marks of the student with the larger average percentage using printResult. The sample output's mentioned on the next page. In this task, you'll be writing a program that calculates the average percentage of students given their percentages for their individual courses, and identifies which student has the higher average percentage (assume the percentages won't ever be equal). The students will be modelled as instances of the class named marksBreakdown. The class has the following member variables and functions: • Member Variables (all private): o An integer variable named "cs200" o An integer variable named "cs210" o An integer variable named "cs225" o A double variable named "average" • Member Functions (all public): o Default Constructor: Set the value for all member variables to zero o Parameterized Constructor: Used to set the values for cs200, cs210, cs225 only o Setters: Used to set the values of every member variable ■setCS200, setCS210, setCS225, setAverage o o Getters: Used to get the value of every member variable ■getCS200, getCS210, getCS225, getAverage printResult: This function prints out the marks for CS200, CS210, CS225 and the average percentage of a student (according to the sample output) Note: You can ONLY access the values of cs200, es210, and cs225 directly when you're taking their input from the user in main(), after which you'll have to assign them to their respective member variables using the setter functions. Once they're assigned, you MUST use the getter functions to access their values throughout your code. In main(), take the user's input for the marks of 2 students (make sure they're between o and 100), and create 2 instances of marksBreakdown to represent the 2 students. Initialize one student using the setter functions, and the other student using the parameterized constructor. Next, use the setAverage setter to calculate the average percentage (assume every course has equal credit hours) of each student (you're not allowed to pass the marks from main()). Once the average percentage for both students have been computed and assigned to the average member variable, compare both students' average percentage in main(), and print it out with the marks of the student with the larger average percentage using printResult. The sample output's mentioned on the next page.
Expert Answer:
Answer rating: 100% (QA)
Here is the implementation of the program in C with comments include include needed for setprecision using namespace std class definition class marksB... View the full answer
Related Book For
Business Statistics In Practice
ISBN: 9780073401836
6th Edition
Authors: Bruce Bowerman, Richard O'Connell
Posted Date:
Students also viewed these accounting questions
-
The Task In this project, you will be writing a program that receives a string of characters via the UART, checks if this string is a palindrome, and then uses a print function to print either Yes or...
-
In this assignment, you are writing a program that converts common texting abbreviations to English words to allow people like yours truly can understand. For the assignment, you are provided with a...
-
Goodwill impairment tests are carried out annually. During 2014, goodwill impairment was determined to be $26,000 on the parents share of goodwill and $5,000 on the NCI share. In 2016, impairment in...
-
Prepare an Orientation Plan for the select position utilizing the theories discussed in the text. Discuss appropriate and effective orientation plans and your decision-making process for selecting a...
-
Show that the difference between decibel levels B1 and B2 of a sound is related to the ratio of the distances r1 and r2 from the sound source by B2 B2 = 20 log (r1/r2)
-
While performing a detailed review of its financial records, Doors Unlimited noted the following ending inventory errors: Required Calculate the corrected ending inventory and cost of goods sold...
-
Goladen Vineyards is a successful small winery. The owner, Gino Colucchio, is considering an additional line of business: selling wind-generated electricity to the local utility. Tax law requires...
-
You are part of a design team for future exploration of the planet Mars, where g = 3.7 m/s2. An explorer is to step out of a survey vehicle traveling horizontally at 33 m/s when it is 1200 m above...
-
5. Check to see if the sides are proportional by creating ratios between corresponding sides and reducing the fractions: Shortest Sides 5 Middle Sides 11 Longest Sides 13
-
A pipeline carrying gasoline ( $\mathrm{SG}=0.72, \mu=0.7 \mathrm{cP}$ ) is 5 miles long and is made of 6 in. $\mathrm{Sch} .40$ commercial steel pipe. The line contains $2490^{\circ}$ elbows, 2 open...
-
Suppose that (x, y) = x xy + y 2x + 2y with D = {(x, y) | 0 y x 2}. 1. The critical point of f(x, y) restricted to the boundary of D, not at a corner point, is at (a, b). Then 1 3 and b = 2....
-
Question: Find the area of the region bounded by the graphs of the given equations. f ( x ) = x 2 7 x + 2 0 , g ( x ) = 2 x + 6 .
-
Zoe Corporation has the following information for the month of March: Cost of materials placed in production Direct labor Factory overhead $15,968 28,916 35,428 Work in process, March 1 Work in...
-
Write trigger - empvac - which adds a record into a VACATION table for each EMPLOYEE who is INSERTed or UPDATEed into the EMPLOYEE table to ensure the difference between the HIREDATE and CURRENT DATE...
-
Balloons By Sunset (BBS) is considering the purchase of two new hot air balloons so that it can expand its desert sunset tours. Various information about the proposed investment follows: (Future...
-
Noelle, the owner of all of the shares of ClockCo, an S corporation, transfers her stock to Grayson on April 1. ClockCo reports a $264,000 NOL for the entire tax year, but only $39,600 of the loss...
-
Answer the question asap. Hayes Company has provided information concerning items taken from its financial statements to assist you in preparing its statement of cash flows, direct method: 1....
-
The May 2014 revenue and cost information for Houston Outfitters, Inc. follow: Sales Revenue (at standard).............. $ 540,000 Cost of Goods Sold (at standard) ..........341,000 Direct Materials...
-
Explain whether each of the following is a valid probability distribution. If the probability distribution is valid, show why. Otherwise, show which conditions of a probability distribution are not...
-
Total variation = 61.380; SSE = 1.438; b1 = 5.7066
-
National Motors has equipped the ZX-900 with a new disk brake system. We define p to be the mean stopping distance (from a speed of 35 mph) of all ZX-900s. National Motors would like to claim that...
-
The condensed income statement for the Rivera and Santos partnership for 2002 is as follows. A cost behavior analysis indicates that 75% of the cost of goods sold arc variable, 50% of the selling...
-
Your company is evaluating a new project, and you've estimated that the cost of capital for the project will be 8 percent. Assume that you have also projected the following cash flows for the...
-
You are considering the following two mutually exclusive projects. If the cost of capital for both projects is 7 percent, which statement concerning capital-budgeting rules listed will be correct in...
Study smarter with the SolutionInn App