Question:

Last month Joe purchased some stock, the number of shares that joe purchased was 1,000?

by  |  earlier

0 LIKES UnLike

he paid $32.87 per share. he paid his stockbroker a commission that amount of 2% of the amount he paid for the stock

2 weeks later joe sold the stock for $33.92 per share, the number of shares that he sold was 1,000, he paid his stockbroker a commission that amount of 2% of the amount the amount he received from the stock.

Design a program that display the following information:

the amount of money joe paid for the stock.

the amount of commission joe paid his broker when he bought the stock

the amount that joe sold rhe stock for

the amount of commission joe paid his broker when he sold the stock

did joe make money or lose money.

display the amount of profit or loss after joe sold the stock and paid his broker (both times).

 Tags:

   Report

1 ANSWERS


  1. cost = 31.00

    scost = cost * 1000

    ccost = scost * 0.02

    tcost = scost + ccost

    srecv = 33.92 * 1000

    crecv = srecv * 0.02

    trecv = srecv - crecv

    Write(6,1) scost

    1 format(10H Joe paid ,f8.2,23H dollars for the stock )

    Write(6,2) ccost

    2 format(5x,5hplus ,f8.2,20H dollars commission  )

    write(6,3) tcost

    3 format(21H for a total cost of ,f8.2,8H dollars)

    write(6,4)srecv

    4 format(14H Joe received ,f8.2,23H dollars for the stock )

    write(6,5)crecv

    5 format(9x,5Hless ,f8.2,20H dollars commission  )

    write(6,6)trecv

    6 format(17H for a return of ,f8.2,8H dollars)

    profit = trecv - tcost

    xloss = tcost - trecv

    If(profit.ge.0.0) write(6,7)profit

    7 format(21H Joe had a profit of ,f8.2,8H dollars)

    If(xloss.gt.0.0) write(6,8)xloss

    8 format(19H Joe had a loss of ,f8.2,8H dollars)

    stop

    end

    Just change the first line to indicate the price paid per share, then find an old FORTRAN compiler, and you are all set.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions