Question: PLEASE ANSWER IN C NOT C++ Lab 2 Directions Write a C program that runs on ocelot for a salary calculator using only the command

PLEASE ANSWER IN C NOT C++

PLEASE ANSWER IN C NOT C++ Lab 2 Directions Write

Lab 2 Directions Write a C program that runs on ocelot for a salary calculator using only the command line options. You must use getopt to parse the command line. The calculator will only do bonuses and raises to a base salary as well as a veterans bump. Taxes will be deducted from the salary as well. Usage: salary [-bv] [-r rnum] -t tnum base The variable base is the starting salary where the base should be validated to be an integer between 20000 and 90000 inclusive. It would represent a salary. Error message and usage shown if not valid. The -b option it would represent a bonus of 5000 on top of the salary. Error message and usage shown if not valid. . -b adds 5000 to the base. The -r option rnum should be a positive integer between 2 and 10 inclusive. It would represent a percentage raise based on the salary. Error message and usage shown if not valid. . -r multiplies the base by the percentage given and adds it to the base. For example if rnum is a 5, the base is multiplied by 5% and that amount is added to the base. . -v adds a 6000 bump to the base. The -t option should be a positive integer between 5 and 30. . -t with a tnum is required and it will be subtracted from the salary at the end. For example if the tnum is 20 then the salary is multiplied by 20% and then that is subtracted from the salary. Output should have exactly 2 decimal places no matter what the starting values are as we are talking about money. If -v is included, it is executed first. If -r is included it would be executed next. The -b would be executed after the-r and finally the-t is executed. There will be at most one of each option, if there are more than one you can use the last one in the calculation. The source file should have your name & Panther ID included in it as well as a program description and it should have the affirmation of originality from Lab 1. Code should be nicely indented and commented. as in Lab 1. Create a simple Makefile to compile your program into an executable called salary. Test your program with the following command lines and take a screenshot after running the four lines. The command prompt should be viewable. salary -b -r 4-t 10 75000 o result: 74700.00 salary -V -r 7-t 5 40000 o result: 46759.00 salary 80000 o result: Missing taxes. salary -t 20 80000 o result: 64000.00

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 General Management Questions!