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.
Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
The calculator will only do bonuses and raises to a base salary as well as a veterans bump.
Usage: salary [-b bnum] [-r rnum] [-v] base
The variable base is the starting salary where the base should be validated to be an integer between 50000 and 100000 inclusive. It would represent a salary. Error message and usage shown if not valid.
For the -b option bnum should be a positive integer between 1 and 10 inclusive. It would represent the multiplier for a bonus on top of the salary. Error message and usage shown if not valid.
For the -r option rnum should be a positive integer between 5 and 10 inclusive. It would represent a percentage raise based on the salary. Error message and usage shown if not valid.
-b adds (bnum times 1000) to the base.
-r multiplies the base by the percentage given and adds it to the base.
-v adds an 8000 bump to the base.
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 last.
There will be at most one of each option, if there are more than one you can use either of the options in the calculation.
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 three lines. The command prompt should be viewable.
Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
salary -b 2 -r 5 90000result: 96500.00salary -v -r 7 50000result: 62060.00salary 40000result: 40000.00
Turn in your highest-quality paper
Get a qualified writer to help you with
“ Florida State College at Jacksonville Salary Calculator C Program ”
Get high-quality paper
Guarantee! All work is written by expert writers!