Florida State College at Jacksonville Salary Calculator C Program

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.

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.

    salary -b 2 -r 5 90000result: 96500.00salary -v -r 7 50000result: 62060.00salary 40000result: 40000.00

    Calculate your order
    275 words
    Total price: $0.00

    Top-quality papers guaranteed

    54

    100% original papers

    We sell only unique pieces of writing completed according to your demands.

    54

    Confidential service

    We use security encryption to keep your personal data protected.

    54

    Money-back guarantee

    We can give your money back if something goes wrong with your order.

    Enjoy the free features we offer to everyone

    1. Title page

      Get a free title page formatted according to the specifics of your particular style.

    2. Custom formatting

      Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.

    3. Bibliography page

      Don’t pay extra for a list of references that perfectly fits your academic needs.

    4. 24/7 support assistance

      Ask us a question anytime you need to—we don’t charge extra for supporting you!

    Calculate how much your essay costs

    Type of paper
    Academic level
    Deadline
    550 words

    How to place an order

    • Choose the number of pages, your academic level, and deadline
    • Push the orange button
    • Give instructions for your paper
    • Pay with PayPal or a credit card
    • Track the progress of your order
    • Approve and enjoy your custom paper

    Ask experts to write you a cheap essay of excellent quality

    Place an order