# Nt1310 Unit 6 Report

402 Words2 Pages
1) Pseudocode Ask the user to input the stock’s share. Ask the user to input the stock’s sale price. Calculate the cost of the stock. Calculate the commission for purchasing the stock. Calculate the amount sold for the stock. Calculate the commission for selling the stock. Calculate the profit made from the stock. Display the cost to buy the stock. Display the commission for purchasing the stock. Display the amount sold for the stock. Display the commission for selling the stock. Display the profit made from the stock. 2) Complete C++ code // This program is used by Global Warming, Inc. to calculate // The cost, commision purchasing, amount sold, commision selling, profit made after selling stock and paying two commissions #include &lt;iostream&gt;…show more content…
cout &lt;&lt; setprecision(2) &lt;&lt; fixed &lt;&lt; showpoint; // Promt the user for the shares and sale price cout &lt;&lt; "Enter the number of share of the stock : \n"; cout &lt;&lt; "Share: "; cin &gt;&gt; share; cout &lt;&lt; "Enter the sale price of the stock (in RM) : \n"; cout &lt;&lt; "sale price: "; cin &gt;&gt; sale_price; // Calculate the stock's cost, the cost to buy it,the commision purchasing,amount sold,the commision for selling and the profit. cost = share * COST_PER_SHARE; commission_purchasing = cost * CHARGE_PER_SHARE; amount_sold = share *sale_price; commision_selling = amount_sold * CHARGE_PER_SHARE; profit = amount_sold - cost - commission_purchasing - commision_selling; //Display the calculated data. cout &lt;&lt; "The cost to buy the stock is: RM " &lt;&lt; cost &lt;&lt; endl; cout &lt;&lt; "Commision for purchasing the stock is: RM" &lt;&lt; commission_purchasing &lt;&lt; endl; cout &lt;&lt; "Amount sold for the stock is: RM" &lt;&lt; amount_sold &lt;&lt;