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
the area of the curved surface of a solid cylinder is equal to 2/3 of the total area of the same cylinder . If the total surface
zheka24 [161]

Answer:

Sa = 36 circumference per meter square

This answer is wrong sorry

Will you my friend

7 0
3 years ago
Joanna is considering taking out a loan. She has a few options and wants to compare them. Her first option is a single payment l
fgiga [73]

Answer:

the value would be $1,250,000

Step-by-step explanation:

7 0
3 years ago
F(x)=x^2. What is g(x)?
Nina [5.8K]

Answer:

C

Step-by-step explanation:

I'm super sorry if I get this wrong you don't have to choose C I feel like I'm wrong but have a nice day

4 0
3 years ago
Point C is located 8 inches from point A and 6 inches from point B. Points A and B are 2 inches apart.
marshall27 [118]

Answer:

B

Step-by-step explanation:

4 0
3 years ago
HELP...... which is a solution of the equation? 2x - y = 0
Lena [83]

All we need to do is plug the numbers into the equation.


A:

2(3)--1=0\\6--1=0\\7\neq0

Not A.

B:

2(2)--4=0\\4--4=0\\8\neq0

Not B.

C:

2(1)-2=0\\0=0

C is the correct answer

6 0
3 years ago
Other questions:
  • Which expression gives the volume of a sphere with radius 15?
    12·2 answers
  • Which best describes the transformation that occurs from the graph of f(x) = x2 to g(x) = (x – 2)2 + 3?
    12·1 answer
  • Hey please help me if you can I would appreciate it
    12·2 answers
  • Convert 5.4 ⋅ 103 to standard form. 0.0054 0.00054 5,400 54,000
    8·2 answers
  • How can technology be utilized to complete constructions?
    8·1 answer
  • Which expression is equivalent to 8(<br> –<br> 2r+2)?
    14·2 answers
  • Which expression is equivalent to y•y•y•z•z•z•z?
    14·2 answers
  • Which equation has the solution x=12 ?
    6·2 answers
  • <img src="https://tex.z-dn.net/?f=-2cos%5E%7B2%7D%20x-6sinx-1%3D0" id="TexFormula1" title="-2cos^{2} x-6sinx-1=0" alt="-2cos^{2}
    8·1 answer
  • PLEASE ANSWER MY QUESTION PLSSSS, ITS ALMOST DUE, CORRECT ANSWER GETS BRAINLIEST​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!