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
A line passes through the point (-2, 7) and has a slope of -5.
Ludmilka [50]

Answer:

-7

Step-by-step explanation:

3 0
2 years ago
Which equation represents the line whose slope is 1/2 and whose y-intercept is 5
expeople1 [14]

Answer:

y=1/2x+5

Step-by-step explanation:

4 0
3 years ago
Read 2 more answers
Please help!! I attached an image, will give most brainliest
harkovskaia [24]
F because 0 | 2 means 02
4 0
3 years ago
Read 2 more answers
Bob and Dave go to PizzaScoff. Starting with 35 pizzas, Bob eats 6 4/5 pizzas and Dave eats 8 1/3 pizzas. How many are left?
Ray Of Light [21]

Answer:

19.87 Pizzas are left

Step-by-step explanation:

To solve, just take 35 the number of starting pizzas and then subtract the number pizzas both of them consumed. So, 35 - 6.8 given 4/5 converts to 0.8 this leaves use with Bob's pizza consumption only at 28.2 pizza's left. Next, we are going to take 28.2 - 8.33 given 1/3 is .3333 repeating this then gives us the answer with having 19.87 pizzas left - although if it asks how many whole pizzas you would say 28 given you can't have .87 of a pizza.

7 0
2 years ago
What is the length of the diagonal of a 10 cm by 15 cm rectangle?
Archy [21]

The length of the diagonal should be 18 if I am not wrong!

Step-by-step explanation:

a2+ b2=c2

so 10x10+15x15=the diagonal

100+225=325

325 squared = 18

8 0
3 years ago
Other questions:
  • Write the equation of the line in point slope form: <br> 1. (5, -9); m = 6
    14·2 answers
  • Explain how to find the greatest number of identical arrangements that can be made with 54 roses and 42 tulips with no flowers l
    12·2 answers
  • Emma is building wall around
    5·2 answers
  • Sydney is going to a carnival that has games and rides
    6·2 answers
  • Evaluate the following expression.
    8·1 answer
  • Enter the simplified form of the complex fraction in the box. Assume no denominator equals zero. 2/x−1 + 1/x/8/x
    12·1 answer
  • Camryn practices the trumpet every 1 1 th 11 th 11, start superscript, start text, t, h, end text, end superscript day and the f
    10·1 answer
  • 19 times 8 in expanded form
    13·1 answer
  • What is the square root of 134
    7·2 answers
  • Find the equation of the line with the slope 3 that passes through (2,2)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!