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
Write a rule for the linear function (-4)(16),(0)(0),(4)(-16),(8)(-32)
11Alexandr11 [23.1K]
The linear rule should look like this y=a*x+b
As the function graph goes through the (0,0) point, the equation 0=a*0+b <=> b=0 must be true.
Now we only need to find a, using one of the points given. With (-4, 16):
16=-4*a <=> a=16/-4 <=> a= -4
So the rule looks the following way:
f(x)= -4*x 
5 0
3 years ago
Read 2 more answers
I don’t get this lol...really need help with this!
Hunter-Best [27]
Look up the equation for it
4 0
3 years ago
5/3 divided by (-6/7).<br>Write your answer in simplest form.<br><br>Please please Help me!! ​
lana [24]

Answer:

-1  17/18

Step-by-step explanation:

I solved this.

7 0
2 years ago
Read 2 more answers
F(x) = 2x^3 + 8
riadik2000 [5.3K]

Answer:32-10x

Step-by-step explanation:

7 0
3 years ago
LAST ONE !! ILL MARK BRAINLEST AGAIN‍♀️ win win lol <br> Q: what is MAB?
AlexFokin [52]
The Correct Answer Is
144
4 0
3 years ago
Other questions:
  • How many fluid ounces are there in 8 pints 5 cups?
    14·1 answer
  • Two consecutive integers add to 51. what are the integers?
    5·2 answers
  • 3y+4y=-49<br><br> solve for y
    15·2 answers
  • 2 1/2 and 1/2 are reciprocals. True or false?
    14·1 answer
  • Calculate y'. xy^4+x^2y=x+3y
    8·1 answer
  • Sandra has two window's, the larger of which has dimensions 5.5 tunes as big as the smaller.How do the areas of the two window's
    13·1 answer
  • Which of the following values is farthest to the left on the number line?
    12·1 answer
  • Factor the expression using GCF the (greatest common factor)
    7·1 answer
  • Someone tell me the answer
    11·1 answer
  • Houa bought 11 chicken wings for $23.10 . How much does each wing cost
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!