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
If someone is going 24.85 mi/h how far will they have gone in 4 hours?
Leokris [45]
You would have to do 24.85 x 4 because the 24.85 is per hour and if someone is going for 4 hours, this is what we would have to work out. So it would equal: 99.40 miles per hour. :)
6 0
3 years ago
Read 2 more answers
allowing 20% discount on the marked price of a watch the value of the watch will be Rs 6328 when a vat 13%is added ,find the fin
Ahat [919]

Step-by-step explanation:

Let the marked price of a watch be =₹x

∴ Discount price = x- 20% of x

= x - 0.2x

=0.8x

Amount of VAT = 13% of 0.8x

0.13 x 0.8x

0.104x

Now,

Selling price = 0.8x + 0.104x

              ∴6328 = 0.904x

x = 0.904 / 6328

x=0.00014285714

7 0
3 years ago
1.Eric earned a 12 correct points out of 15 total points on his math quiz.
Sholpan [36]

Answer:

Jamie, because 9 out of 10 is a 90 and 12 out of 15 is an 80

4 0
3 years ago
Jordan will hike the trail at a rate of 4mph. Write a linear equation to represent the distance Jordan still has to walk after x
goldfiish [28.3K]

The linear equation would be y = 18 - 4x which represents the distance Jordan still has to walk after x hours.

The y-intercept represents the total distance Jordan has to walk.

<h3>What is the distance?</h3>

Distance is defined as the product of speed and time.

We have to determine the distance.

So distance = speed× time

Given that his speed is 4 mph and x hours of walking, then:

So distance = 4 × x

Let it Start of the trail: 0 miles

And the end of the trail: 18 miles​

The trail length is 18 miles, so if he walked 1 mile, 18 - 1 = 17 miles are left, in general:

⇒ y = 17 - 4(x)

Here y would be the distance Jordan still has to walk.

The y-intercept would be if substitute x = 0, then:

⇒ y = 17- 4(0)

⇒ y = 17

This represents the total distance Jordan has to walk

Hence, the linear equation would be y = 18 - 4x which represents the distance Jordan still has to walk after x hours.

The y-intercept represents the total distance Jordan has to walk.

Learn more about the distance here:

brainly.com/question/13269893

#SPJ1

8 0
1 year ago
A box contains 15 cards. There are 5 red cards labeled 1, 2, 3, 4, and 5. There are 5 blue cards labeled 1, 2, 3, 4, and 5. Ther
suter [353]
The answer is 7/15
hope this helps!

5 0
3 years ago
Other questions:
  • Help asap! find volume of sphere
    15·1 answer
  • HELP PLSSS asappppppp
    15·2 answers
  • Help pleaseee with this and the other ones
    7·1 answer
  • Two functions are given below. How does the graph of
    10·1 answer
  • What’s the solution
    9·2 answers
  • Hurry pls i have an test plssssssssssssssssssssssssssssssssss
    5·1 answer
  • Brice has 400 toy cars. Of the toy cars, 15% are red, 40% are green, and the rest are multicolor. How many toy cars are multicol
    8·1 answer
  • Please help answer either both or one question please! Best answer will get brainliest :)
    10·2 answers
  • Twenty seconds after a plane in the air show- dives, it is 300 feet from where it begin. At what rate is the plane diving ​
    9·1 answer
  • What is 5 + 10 pls pls pls pls pls help
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!