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 <iostream>…show more content…
cout << setprecision(2) << fixed << showpoint; // Promt the user for the shares and sale price cout << "Enter the number of share of the stock : \n"; cout << "Share: "; cin >> share; cout << "Enter the sale price of the stock (in RM) : \n"; cout << "sale price: "; cin >> 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 << "The cost to buy the stock is: RM " << cost << endl; cout << "Commision for purchasing the stock is: RM" << commission_purchasing << endl; cout << "Amount sold for the stock is: RM" << amount_sold <<

More about Nt1310 Unit 6 Report

Open Document