create a variable chart for: //Variable declarations: Declare real stockShares = 1000 //Number of shares purchased Declare real stockPurchasePrice = 32.87 //How much each share bought for Declare real stockSoldPrice = 33.92 //How much each share sold for Declare real commissionRate = 02 //Broker’s 2% commission // Note: Flowgorithm does not allow variables to be declared and initialized with a value in // the same statement. // Therefore, you have to first declare each variable, then assign the given value in a separate statement. Declare real stockBuyAmtPaid //Total paid for purchased stock Declare real buyCommissionPaid //Broker’s commission from stock buy Declare real stockSaleAmtMade //Total received from stock sale Declare real sellCommissionPaid //Broker’s commission from stock sale Declare real profitOrLoss //Result of both stock transactions
Answer: Hey! I designed this in the flowgorithm as you mentioned in the question. All variables declared as real and then assign them values. All calculations are done. First, calculate the total amount for purchase and calculate the broker's commission on purchasing. Note- I added this commission to the total amount for purchasing. I was confused here. If want to change, you can. Then calculate the total sold price and calculate the broker's commission and subtract it from total sold amount. Then it will calculate profit or loss after commission paid to brokers. If the buy amount is less than sold amount then he got profit otherwise loss. It is showing also how much he got profit or loss. If any query you have, feel free to ask me, I would be very happy to solve. Thanks.
Get Answers For Free
Most questions answered within 1 hours.