Question
(C++) Dynamic array data input from a text file, sort it, manipulate it, etc. Help! When your program first starts, it should read a file
(C++) Dynamic array data input from a text file, sort it, manipulate it, etc. Help!
When your program first starts, it should read a file called Stocks.txt that contains some initial stocks data. Store the stocks information in alphabetical order, by stock symbol. The stocks from the file should be added into your program before any other user input is given. As soon as the Stocks.txt file is read, display the current list of stocks and then proceed to the menu based section below. The Stocks.txt file is attached. Your menu-based program must include the following capabilities: 1. Add a new stock. You will enter 3 pieces of information for each stock: The stock ticker symbol (eg MSFT), The stock company name (eg Microsoft). The stock price (eg 90.00). Dont fret about trying to enter correct or current stock prices. 2. Edit a stock. Provide the ability to locate a stock based on its respective symbol and change the current price. 3. Delete a stock. Offer the user the opportunity to enter a stock symbol and, if found, to delete the stock. If the particular stock symbol is not found, simply display an informative message to the user. 4. Display all stocks. Display a list of all the current stocks stored in your array. 5. Exit Exit your program. You do not save any of the stock information to a file, just exit. Make sure you check for and eliminate all memory leaks from your program. No use of C++ strings, vectors, classes, etc., use cStrings in the array, and pointers. You are likely to find this a challenging program to write. My code is about 420 lines long (without comments).
(Stocks.txt) =
NFLX,Netflix,220.46 MSFT,Microsoft,90.00 AAPL,Apple Computer,178.46 ORCL,Oracle,50.58 IBM,IBM,162.37 HPQ,HP Inc,23.70 GOOG,Alphabet,1137.51 FB,Facebook,181.29 AMZN,Amazon,1294.58
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started