Trading System in C++
Trading system deals with finance management. It gets the input from the console and display the output in the console. It has the following components. A structure ‘ T_order ’ with 3 elements. It has t_type,t_quantity and t_price. A class ‘ TradingSystemEg ’ creates a vector and a variable ‘t_balance’. ‘placeIt()’, ‘showIt()’ are the two functions to buy the units and displayed. The constructor TradingSystemEg() is used to initialise the variable values. ‘placeIt()’ – it gets the three values as function input. This function checks the balance is greater than quantity ,then the type is “ BUYIT ”, the balance is reduced as quantity and multiplied with the price value. ‘showIt()’ – it displays the balance value and unit value. ‘main()’ – it creates the object for TradingSystemEg. The object calls the function. Code: #include <iostream> #include <vector> #include <string> struct T_Order { ...