1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Gennadij [26K]
3 years ago
12

Write the computer program for;urgent​

Mathematics
1 answer:
AlladinOne [14]3 years ago
8 0

ANSWER:

#include <stdio.h>

#define PAYRATE 10 //basic pay rate per hour

#define OVERTIME 15 //in excess of 40 hours a week

int NetPay(int hours);

int main()

{

int userWeeklyHours;

printf("Please enter your total weekly working hours: \n");

scanf("%d", &userWeeklyHours);// get the user weekly hours

NetPay(userWeeklyHours);

return 0;

}

int NetPay(int hours)// implementing the function to calculate total pay, total taxes, and net pay

{

int firstRate, secondRate, restOfRate, secondAmount, rest, payAfterTax, payedBeforeTax, overHours;

if (hours > 40)

{

overHours = hours - 40;

payedBeforeTax = (40 * PAYRATE) + (overHours * OVERTIME);

}

else

payedBeforeTax = hours * PAYRATE;//defining the user first paycheck before taxes

if (payedBeforeTax <= 300)//paying only first rate case

{

firstRate = payedBeforeTax*0.15;

payAfterTax =payedBeforeTax - firstRate;

printf("your total gross is %d, your taxes to pay are %d, your net pay is %d", payedBeforeTax, firstRate, payAfterTax);

}

else if (payedBeforeTax > 300 && payedBeforeTax <= 450)//paying first and second rate

{

secondAmount = payedBeforeTax - 300;

firstRate = (payedBeforeTax - secondAmount) * 0.15;

secondRate = secondAmount * 0.20;

payAfterTax = payedBeforeTax - (firstRate + secondRate);

printf("your total gross is %d, your taxes to pay are %d, your net pay is %d", payedBeforeTax, firstRate + secondRate, payAfterTax);

}

else if (payedBeforeTax > 450)// paying all rates

{

rest = payedBeforeTax - 450;

secondAmount = (payedBeforeTax - 300) - rest;

firstRate = (payedBeforeTax - (rest + secondAmount)) * 0.15;

secondRate = secondAmount * 0.20;

restOfRate = rest * 0.25;

payAfterTax = payedBeforeTax - (firstRate + secondRate + restOfRate);

printf("your total gross is %d, your taxes to pay are %d, your net pay is %d", payedBeforeTax, firstRate + secondRate + restOfRate, payAfterTax);

}

return payAfterTax;

}

You might be interested in
For what values of a and b is the line 3x y=b tangent to the curve y=ax3 when x=3?
Sav [38]
Hello : here is a solution 

6 0
3 years ago
What is the solution set of the given system?
AVprozaik [17]

What is the system? (Is there supposed to be an image?)

3 0
3 years ago
Greatest common factor of 24 and 76
Leto [7]
The GCF of 24 and 76 is 4.
4 0
3 years ago
Read 2 more answers
?
monitta
The school purchase 1200 notebooks
4 0
3 years ago
Read 2 more answers
What adds to get 3 but multiplies to get negative 18
Colt1911 [192]
6 and -3

6 + -3 = 3

6  x -3 = -18

Hope that helps! 
3 0
3 years ago
Other questions:
  • 1,000 cubic centimeters equals 1 ____?
    14·2 answers
  • A butcher has 8 1 3 pounds of ground beef that will be priced at $4.64 per pound. He divides the meat into 8 equal packages. To
    9·1 answer
  • writing at a Constant rate, amir wrote a 16-page report in 2 1/2 hours. at what constant rate did amir write
    14·1 answer
  • You see a£97 top but don't have enough money so u borrow£50 from ur mumsy and £50 from ur dad=100 you buy the top and get £3 cha
    10·1 answer
  • -34 -2p = 8(8 - 2p)​
    13·1 answer
  • Which term describes a fraction that has a variable or variable expression in its numerator, its denominator, or both?. . A.Vari
    14·2 answers
  • Will give brainliest
    11·1 answer
  • 15 POINTS!!!help me pls!
    14·2 answers
  • Shape p is translated to shape Q using vector (a b). <br> Please find A. <br> Photo attached.
    8·1 answer
  • I need help rn help me and give an explanation
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!