Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Page 3 . Assume the user input 40 and 26.5 as the input data for the following c

ID: 3726000 • Letter: P

Question

Page 3 . Assume the user input 40 and 26.5 as the input data for the following c++ program, what will the EXACT output of this program? (20 points) tinclude ciostream> using namespace std double Get datal; double Compute Gross_Salary(double, doublej; double Compute Tax (double) double Compute Net Salary (double, double); void Display info (double); Int main(void) double rate, weekly _hours, gross salary, Tax, Net; weekly hours Get data): gross_ salary - Compute Gross Salarytweekly_hours, rate): Tax Compute_Tax (gross salary) Disoi co infort tot Salary (gross, saliary, Tax Display infolNet); return 0; double Get data(void) double data; cin >> data; return data; double Compute Gross Salaryldouble WH, double R) double Gs return GS double Compute Tax (double GS) double Tax if (GS> 500.00) GS . 0.25; Tax olse Tax GS 0.15; return GS double Compute Net Salary (double GS, double T) double NS return NS; void Display info (double info) cout ce info

Explanation / Answer

In Compute_Gross_Salary function

GS=WH*R=40*26.5=1060

Therefore gross_salary=1060

You have written the mistake in Compute_Tax function i.e. u have to write return Tax instead of return GS

Since GS(1060)>500 so Tax=1060*0.25=265

Therefore Tax=265

In Compute_Net_Salary function

NS=GS-T=1060-265=795

so the correct output is

265

795