• Trader

    At the end of this problem you should submit to Laulima:

    • a file named UHusername_trader.c
    • example:

      • zhaol_trader.c
    • Options are contracts to buy or sell a given stock at a given strike price. The buyer of a put option can exercise the right to sell a given stock at a strike price from the seller of the put option. The buyer of a call option can exercise the right to buy a given stock at a strike price to the seller of the call option.

      Write a program that allows an option trader to enter in a stock’s market price and the highest strike price available in the options market for that particular stock. The program will output the difference between the stock’s current market price and the strike price for each of the available strike prices. The program will also tell the option trader how much money s/he will make/lose if s/he owned the call/put option and exercised the right to buy/sell the given stock.

      Assume the contracts are only for 1 stock and the available strike prices are at \$5 intervals from the highest available strike price until the strike price is no longer above $0.00.

      Don't worry about rounding or truncating errors. Just let printf handle the precision. The program will exit after displaying the results for one market price and one strike price

      Examples Cases:

      • example case 1:
        Enter in market price:
        [user enters in 11 as the stock's market price]
        Enter in strike price:
        [user enters in 12 as the highest available strike price]
        ---
        Strike Price: \$12.00
        Call: Gain \$1.00
        Put: Lose \$1.00
        ---
        Stricke Price: \$7.00
        Call: Lose \$4.00
        Put: Gain \$4.00
        ---
        Strike Price: \$2.00
        Call: Lose \$9.00
        Put: Gain \$9.00
        
      • example case 2:
        Enter in market price:
        [user enters in 15 as the stock's market price]
        Enter in strike price:
        [user enters in 13 as the highest available strike price]
        ---
        Strike Price: \$13.00
        Call: Lose \$2.00
        Put: Gain \$2.00
        ---
        Stricke Price: \$8.00
        Call: Lose \$7.00
        Put: Gain \$7.00
        ---
        Strike Price: \$3.00
        Call: Lose \$12.00
        Put: Gain \$12.00
        
  • Displayer

    At the end of this problem you should submit to Laulima:

    • a file named UHusername_displayer.c
    • example:

      • zhaol_displayer.c
    • Write a program that displays a smiley face with borders like this:

      ---------
      |  . .  |
      |   |   |
      | \___/ |
      ---------

      Try to write the program as flexible as possible by using functions and macros so updating/maintaining/modifying the program will be as painless as possible.