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
What is the sum of the arithmetic series: s10 = -20, d = 4, a1 =? ​
Otrada [13]
<h2>Step-by-step explanation:</h2><h3>\green\star Given</h3>

\blue\stars10 = -20

\blue\starn = 10

\blue\star an = -20

\green\star solution

\green\stars10 = n\2 [a+(n-1)d]

\green\star-20 = 10a2[a+(10-1)4]

\green\star-4 = a +36

\green\stara1 = -40

\small\boxed{a = -40}

Hope it helps.

Hope it helps

8 0
3 years ago
Read 2 more answers
Pls help me and fast!!
uysha [10]

Answer:

Ven diagram is the answer.

Step-by-step explanation:

I don't think you were able to use a ven diagram from the start.

8 0
3 years ago
I don’t understand this
zhuklara [117]

Answer:

i think it is the last one.

7 0
3 years ago
A student takes a multiple-choice test with 8 questions on it, each of which has 4 choices. The student randomly guesses an answ
zimovet [89]

Answer:

0.900

Step-by-step explanation:

hope it helps u

need more answers?

just follow me

3 0
3 years ago
Someone please help me!<br> 15 points
Genrish500 [490]

Answer:

g . 47.6 degrees.

Step-by-step explanation:

g.  The 3 towns form a right angled triangle and

tan A = BC/BA

= 105 / 96

A = 47.6 degrees.

6 0
3 years ago
Other questions:
  • The most number of cans collected by any student in the save the Earth Club was 256 write on inequality to express the number of
    9·1 answer
  • X divided by 6 is 4. What is Z?
    12·1 answer
  • What is the equation of the quadratic graph with a focus of (3, 1) and a directrix of y = 5?
    11·1 answer
  • 9,6 is a point on the circle that has its center at 3,-2 what is the radius of the circle
    6·1 answer
  • Mrs. Hilt has 6 pizzas. Each pizza has 6 slices. She
    10·2 answers
  • WILL MARK BRAINLIEST
    6·2 answers
  • Plzzzz helllp mmmmeee thx
    15·2 answers
  • What do balloon mortgage and ARM have in common?
    5·2 answers
  • If m∠ADB=(6x−4)° and m∠BDC=(4x+24)°, find the value of x such that ∠ADC is a right angle.
    15·1 answer
  • 10=7-m<br> h+6/5 =2<br> 6+5(m+1)=26
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!