Question: This code is in C please let me know how to do it, if possible pls let me know a good IDE i can test

This code is in C please let me know how to do it, if possible pls let me know a good IDE i can test it at, and can also turn it into a zip file thank you.

Learn to work with command line options and arguments

Gain more experience with Makefiles

Gain more experience with Unix

Usage: salary [-p] -h hours [-b bonus] hourlyrate

In this assignment, you are asked to do a salary calculation. All information needed for this will be passed to the program on the command line. There will be no user input during the execution of the program.

You will need a few pieces of information. The hourly rate for the employee and the number of hours worked. Optionally, you can give a bonus and or a percentage increase (if it was a holiday week or something like that.)

To figure the salary follow these steps:

1. Multiply the hourly rate by the number of hours.

2. If there is a precentage increase then multiply the previous result by 10%, which is done by multiplying by 0.10.

3. If there is a bonus then add it to the previous result.

-p is optional so there may or may not be the percentage increase.

-h is required and indicates the number of hours worked as an integer. It cannot be more than 80.

-b is optional and would give an integer amount for a bonus. It should not be more than 50% of the calculated salary.

You will print out the resulting payment amount as follows. Use rounding to keep money to two decimals and percentages to three decimals.

"The salary for this period is $##,###.##"

There should be no other output at all to the screen.

Please submit your work through Canvas as one zip file called FirstnameLastnameA2.zip. Follow the instructions below carefully (to avoid unnecessary loss of grade). Include your source code and your Makefile in the zip file. I should be able to create the executable by typing make. The Makefile should also contain a 'clean' target for cleaning up the directory (removing all object files). Make sure you don't include intermediate files: *.o, executables, *~, etc., in your submission. (There'll be a penalty for including unnecessary intermediate files or any folders).

Makefile named Makefile

Typing make at the command line should create executable named salary

This criterion is linked to a Learning OutcomeMake file should include a clean target which removes all object files at a minimum.

There should be no warnings during compile

Comment at the top needs a program description

Program should have good comments throughout the body and describing each function

No use of break or continue statements except in a switch

This criterion is linked to a Learning OutcomeProgram must exit with a return code of 0 on success of and error code in other cases

This criterion is linked to a Learning OutcomeThe program used getopt to parse the command line

This criterion is linked to a Learning OutcomeWhenever an error occurs on the command line the user is given the usage statement and an appropriate error message if needed

This criterion is linked to a Learning OutcomeThe call to getopt had the correct parse string

This criterion is linked to a Learning OutcomeThe program must check for command line errors

This criterion is linked to a Learning OutcomeThe program must read the hourly salary using optind.

This criterion is linked to a Learning OutcomeThe program must validate the number of hours properly.

This criterion is linked to a Learning OutcomeThe program must validate the bonus.

This criterion is linked to a Learning OutcomeThe program should calculate the percentage increase properly.

This criterion is linked to a Learning OutcomeThe program should run all test cases properly. Test cases are not provided ahead of time.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!