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

During the tax season, every Friday, the J&J; accounting finm provides assistano

ID: 3721169 • Letter: D

Question

During the tax season, every Friday, the J&J; accounting finm provides assistanoe to people who prepare their own tax returns. Their charges are as follows: a. If a person has low income ( 25,000) and the consulting time is less than or equal to 30 minutes, there are no chargs; otherwise, the service charges are 40% of the regular hourly rate for the time over 30 minutes. b. For others, if the consulting time is less than or equal to 20 minutes, there are noservice charges; otherwise, service charges are-of-ot regular hourly rate for the time over 20 minutes For example, suppose that a person has low income and spent 1 hour and 15 minutes, and the hourly rate is $70.00. Then the billing amount is 70.00 x 0.40 x (45/60)$21.00) Write a program that prompts the user to enter the hourly rate, the total consulting time, and whether the person has low income. The program should output the billing amount. Your program must contain a function that takes as input the hourly rate, the total consulting time, and a value indicating whether the person has low income. The function should retun the billing amount. Your program may prompt the user to enter the consulting time in minutes,

Explanation / Answer

/*========================================================

C++ Program for Calculating J&J Service charges

*=========================================================*/

#include <iostream>

#include<stdio.h>

using namespace std;

//function to return billing amount

float billingAmount(float hourlyRate,float consultingTimeInMin,bool lowIncome){

float charges = 0;

//if low income

if(lowIncome){

//apply charges if time greater than 30min

if(consultingTimeInMin > 30){

consultingTimeInMin -= 30; // time over 30 min

charges = 0.4f; //40 % charges

}

}else{

//apply charges if time greater than 20min

if(consultingTimeInMin > 20){

consultingTimeInMin -= 20; // time over 20 min

charges = 0.7f; //70 % charges

}

}

return hourlyRate * charges * (consultingTimeInMin/60);

}

int main() {

float hourlyRate,consultingTimeInMin,income;

bool lowIncome;

cout<<" ************* J&J Accounting ********"<<endl;

cout<<" Enter Hourly Rate : $";

cin>>hourlyRate;

cout<<" Enter consulting Time In Minutes:";

cin>>consultingTimeInMin;

cout<<" Enter Income : $ ";

cin>>income;

//check if low income i.e <= $25,000

lowIncome = (income > 25000) ? 0:1;

printf(" Total Billing Amount: $ %.2f",billingAmount(hourlyRate,consultingTimeInMin,lowIncome));

return 0;

}

//====================================END=================================

Hope it Helps !