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 line below are parallel. If the green line has a slope of -1/2, what is the slope of the red line?
Phoenix [80]

Answer:

The slope of the red line is -1/2

Step-by-step explanation:

Parallel lines always have the same slope

7 0
3 years ago
Read 2 more answers
How much is 78 cents per pound for 5 pounds
velikii [3]

Answer:

$3.90

Step-by-step explanation:

78 cents/lb * 5 lb = (78*5) cents = 390 cents (the pound labels divide out)

But 390 cents = $3.90

4 0
3 years ago
Read 2 more answers
Which graph represents the function f(x)=3x-2/x-2
Marta_Voda [28]
ANSWER

The last graph is the correct answer

EXPLANATION

The function,
y = \frac{3x - 2}{x - 2} is a rational function.

This rational function has a vertical asymptote

at where the denominator is zero.

That is,
x - 2 = 0

This means that, the vertical asymptote occurs at

x = 2

The graph also has a horizontal asymptote at,

y = \frac{3}{1}

Thus, the horizontal asymptote occurs at
y = 3

At x-intercept,
f(x) = 0

This implies that,

\frac{3x - 2}{x - 2} = 0

\Rightarrow \: 3x - 2 = 0

3x = 2

\Rightarrow \: x = \frac{2}{3}

The graph cuts the x-axis at,

( \frac{2}{3} ,0)

At y-intercept,

x = 0

This implies that,

f(0) = \frac{3(0) - 2}{0 - 2} = \frac{ - 2}{ - 2} = 1

The graph cuts the y-axis at,

(0,1)

The graph that satisfy all the above conditions is the last one.

3 0
3 years ago
Read 2 more answers
40 POINTS AND BRAINLIEST<br><br>What is the function rule that describes the pattern in the table?
taurus [48]

 

linear function i could be wrong

7 0
3 years ago
6x2 + 12x + 2 = -10<br> Quadratic equation solve
Pani-rosa [81]
Add 10 on both sides

6x^2+12x+12=0.

Divide by 6 on both sides.

X^2+2x+2=0

Plug into quadratic formula

X=(-2 +\- (2^2-4•1•2))^1/2) /2•1
X=(-2 +\- (-4)^1/2)/2
X=(-2+\- 2i) /2
X=-1+\- I
X= -1 + i OR -1 - i
7 0
3 years ago
Other questions:
  • Is this distributive property a(b+c)=b+a x c
    15·1 answer
  • A store down the street is selling a bicycle for 45% off the retail price. The bicycle regularly sells for $115.00. What is the
    7·1 answer
  • Which equation can be used to find the perimeter of a regular octagon with sides of length 12?
    14·1 answer
  • PLEASE HELP ILL GIVE 25 POINTS FOR IT
    12·1 answer
  • 6. Find JL.<br> Please and thank you. 5x-16=3x+4
    14·1 answer
  • Use complete sentences to explain in detail how you would use the substitution method to solve the following system of equations
    12·1 answer
  • Express as a single power.
    6·1 answer
  • System of equations- does this have one solution, many solutions or no solution
    11·1 answer
  • Find the length of the segment AB.
    9·2 answers
  • Solve the equation square root 2x – 7 + x = 5 algebraically, and justify the solution set
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!