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
6.3 divided by 2.5 HELP ME PLZZZZZZZZZZZZZZZ
Vadim26 [7]

Answer:

6.3/2.5=2.52

Step-by-step explanation:

5 0
3 years ago
Read 2 more answers
use the quadratic formula to slove the equation. if necessary, round to the nearest hundredth. x^2+3=-4x
nexus9112 [7]

Answer: The zeros are x= -1 and x= -3

7 0
3 years ago
Figure ABCD is a rhombus. What other term describes figure ABCD?
Maslowich
Paralellogram and quadrilateral and polygon
4 0
3 years ago
Read 2 more answers
A basketball has a diameter of 9.5 inches what is the volume of the basketball using 3.14 for pi.
Step2247 [10]

Answer:

  448.69 in^3

Step-by-step explanation:

The volume of a sphere is given by the formula ...

  V = (4/3)πr^3

We want to use diameter, so we can substitute r = d/2 into the formula:

  V = (4/3)π(d/2)^3 = (4/(3·8))πd^3

  V = (π/6)d^3

For the given numbers, ...

  V = (3.14/6)(9.5^3) ≈ 448.69 in^3 . . . . volume of a basketball

7 0
2 years ago
Write the inverse of the conditional statement.
Maslowich
The answer is a I'm pretty sure
7 0
3 years ago
Other questions:
  • What is the value of 3.5(11)+1.9(11)+1.6(11)​
    12·2 answers
  • Solve 322 +63 +3=0 using the Quadratic Formula.<br> X=
    12·1 answer
  • How can i find the weight of the moon?
    8·1 answer
  • Which measure is less than 435 inches
    5·2 answers
  • Write the ratio as a fraction in simplest form.
    10·1 answer
  • Please hurry
    6·1 answer
  • Simplify completely:<br> 4V10 – V6 +3710<br> Show all work for full credit.
    15·1 answer
  • ren &amp; abby are reading the same book for their english class. ren is on page 100 of the book, and she reads 1/2 of a page ea
    6·2 answers
  • Sarah is paid $20 an hour at her new job. She wishes to graph her total pay y, as a function of the number of hours, x. She want
    12·1 answer
  • 30 times 4 times the ten power of three
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!