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
Solve for x<br><br> 1/5(2/3x - 1/2) &gt; x + 1/3
taurus [48]

Answer:

x<-11/26

Step-by-step explanation:

1/5(2/3x-1/2)>x+1/3

2/15x-1/10>x+1/3

2/15x-x>1/3+1/10

-13/15x>11/30

x<(11/30)(-15/13)

x<-11/26

3 0
2 years ago
Evaluate -4,550 divided by 7
Debora [2.8K]

Answer: -650

Step-by-step explanation:

I hope this helps :))

5 0
3 years ago
Please anyone help!!
12345 [234]
Steps:

Answer: 7000 degrees per second
7 0
1 year ago
Read 2 more answers
Which rational number equals 0.7 ? 1 10 Flo 11​
saul85 [17]

Answer:

0.7 is a rational number... but 7/10

Step-by-step explanation:

Hope I helped!

5 0
3 years ago
Read 2 more answers
What is 1,349,400,000 in scientific notation
ahrayia [7]
Move your decimal to the left 9 times that is why the decimal is in the answer.
move the decimal to the right that's in the answer I gave you, you get the number you asked about
1.3494x10^9
3 0
3 years ago
Read 2 more answers
Other questions:
  • If 2=27,what is the measure of the supplement of gbc
    5·1 answer
  • I have no idea how to do this
    5·1 answer
  • What value represents the number of ways in which the expected classes are free to vary in the chi-square goodness-of-fit test?
    13·1 answer
  • Kaci works at a bread store. She has 8 1/4 pounds of dough. She is making .75 pounds loaves. How many loaves will she be able to
    6·2 answers
  • How long does it take a cor travelling at 60 mph. to cover 5 miles?​
    6·1 answer
  • A horizontal line has points J, K, L. A line extends from point K up and to the right to point M. Angle J K M is (10 y + 6) degr
    13·2 answers
  • What is the quotient of 17 and x
    14·2 answers
  • -10+16 divided by (-2)+7<br><br> *Please show work!*
    10·2 answers
  • Determine m∠U if m∠R = 9x - 10 and m∠U = 3x + 4.
    10·1 answer
  • Which graphs show continuous data?<br><br> Select each correct answer.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!