Question: Write a program in C++ using data structures(Stacks,Queues,Linklist,Trees,graphs,searching sorting algorithms) in which you will have 1000 Dollar by default. you can buy and sell three
Write a program in C++ using data structures(Stacks,Queues,Linklist,Trees,graphs,searching sorting algorithms) in which you will have 1000 Dollar by default. you can buy and sell three different assets lets say Asset1, Asset2, Asset3. Price of Asset 1 is 10, Price of Asset 2 is 20, Price of Asset 3 is 30, It should ask you if you want to buy or sell your assets, then it should show your Dollars available, and let you choose the asset you want to buy/sell then the user must enter the amount of asset he wants to buy. the dollars should be subtracted and the asset should show in his portfolio. It should Look like this:
Welcome to your portofolio Would you like to Buy assets? Press 1 Would you like to Sell Assets? Press 2
Your current balance: 1000$
-----------------------------------------
1:
Asset 1 : 10$ (Press 1)
Asset 2: 20$ (Press 2)
Asset 3: 30$ ( Press 3)
1
How much amount of Asset 1 you want to buy?
50
Asset 1 bought for amount 50$
Remaining balace : 950$
The Selling part should work respectively and all the data should be stored in file.
THis is a DATA STRUCTURE ASSIGNMENT so use data structures in this, you can change the program to fit in data structures but the idea must be same.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
