Question: Using Microsoft Visual Studio you will create a Visual C++ desktop project that will read the contents of a data file, convert the data using
Using Microsoft Visual Studio you will create a Visual C++ desktop project that will read the contents of a data file, convert the data using a class definition, and insert the results into a listbox.
Use the following file for data input:
DATA.txt
(A - Alpha B - Bravo C - Charlie D - Delta E - Echo F - Foxtrot G - Golf H - Hotel I - India J - Juliet K - Kilo L - Lima M - Mike N - November O - Oscar P - Papa Q - Quebec R - Romeo S - Sierra T - Tango U - Uniform V - Victor W - Whiskey X - Xray Y - Yankee Z - Zulu 0 - Zero 1 - Wun 2 - Too 3 - Tree 4 - Fower 5 - Fife 6 - Six 7 - Seven 8 - Ait 9 - Niner)
2. Class definition
Create a class definition and name it:
ConvertText
3. Add a method to the class definition
Create a public method and call it:
Convert
Convert should accept a string object and return a TCHAR array.
4. Capture the button click
Capture the button click event in the main module.
Instantiate (create an object from) the class.
Within the button capture block in the WndProc() function, perform the following steps:
-
Insure that the listbox is empty.
-
Read the data file into a locally defined array.
-
After closing the file convert each element of the array using the class method created in step 3.
-
Add each converted text element to the listbox.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
