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 an equation for the line that is parallel to the glven line and that passes
Wewaii [24]

Answer:

The answer to your question is  y = x - 23

Step-by-step explanation:

Process

1.- Get the slope of the line

If two lines are parallels, it means that they have the same slope.

                                 y = 1x - 10

Slope = m = 1

2.- Get the equation of the line

                               y - y1 = m(x - x1)

                               y + 29 = 1(x + 6)                 Substitution

                               y + 29 = x + 6                     Expanding

                               y = x + 6 - 29                      Simplifying

                               y = x - 23

4 0
3 years ago
Read 2 more answers
In a right triangle, one of the legs is 5 cm smaller than the hypotenuse, and the other leg is 10 cm smaller than the hypotenuse
nata0808 [166]

Answer:

25 cm.

Step-by-step explanation:

If the hypotenuse is  x cm long the 2 legs are  x-5 and x-10 cm long.

So by the Pythagoras theorem:

x^2 = (x - 5)^2 + (x - 10)^2

x^2 = x^2 - 10x + 25 + x^2 - 20x + 100

x^2 - 30x + 125 = 0

(x - 5)(x - 25) = 0

x = 5, 25

We can discard x = 5 because that would make the lengths of the legs negative so the hypotenuse = 25 cm long.

3 0
3 years ago
Hey What is -5t &gt; 10
yanalaym [24]

Answer: 10 (ten) is an even number

following 9 and preceding 11

Step-by-step explanation:

3 0
3 years ago
Events A and B are independent. The probability of A given B has occurred is 0.43, and the probability of B given A has occurred
Fofino [41]

Answer:

0.43* 0.35 = 0.1505 or 0.15 after rounding

Step-by-step explanation:

4 0
3 years ago
Can you please check if this is correct?
Reika [66]

Answer: not sure how helpful this is, but the second one is correct (if it's the one that's corresponding to the blue line). The pink line, however, is incorrect if it is corresponding to the first equation. The first equation must have a y-intercept of 1.

Step-by-step explanation:

4 0
3 years ago
Other questions:
  • Given a segment with endpoints A and B, what figure can you contrust using the steps below?
    13·2 answers
  • Continue the number pattern/sequence:
    12·1 answer
  • Five times a number is 5 more than the number
    5·2 answers
  • Polar coordinates of a point are given. Find the rectangular coordinates of the point. (-5, -180°)
    8·1 answer
  • Find the slope of the line that contains the points (6,-3) and (6,5)
    5·2 answers
  • Solve x2 + 10x = 24 by completing the square. Which is the solution set of the equation?
    8·1 answer
  • What does this emoji mean?
    5·2 answers
  • Find a​ point-slope equation of the line having the given slope and containing the given point.
    10·1 answer
  • Find the value of x. NO LINKS WILL REPORT
    15·1 answer
  • George takes a photograph of a rectangular window that is 312 feet tall and 134 feet wide. He prints the photograph on paper so
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!