Write a back–end class called CSVFileLoader and save it in a file called CSVFileLoader.cpp. This class must have the following structure: Private Members Data Type Name Description boolean cFileReadSuccessful This member will indicate if the file-read operation was successful. Private Methods Return Type Method Signature Description int determineNumberOfColumns(string fileName) This method must determine the number of columns in the file. Insert a debug instruction that will display the number of columns as the method exits. void splitData(string line, TUTCell data[]) This method must split the line into separate elements and store each element in the data[] array. Insert a debug instruction that will display the data content of each element as it is inserted into data[] array. Public Methods Return Type Method Signature Description TUTTable loadFile(string fileName, string subjectCode) This method must load the data of the file into a table object. Only students with the same subject code as indicated by the subjectCode input argument may be added to this table. At the completion of this method it must return the populated table. Hint: Make use of the determineNumberOfColumns() and splitData() methods in this method. At the beginning and end of this method insert similar debug instructions as those in the copy constructor of the TUTTable class. Also insert a debug instruction that will display the content of each line as it is read from the CSV file. boolean readSuccessful() This method must indicate if the read process was completed successfully by returning true or false.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter11: Exception Handling
Section: Chapter Questions
Problem 4E
icon
Related questions
Question

Write a back–end class called CSVFileLoader and save it in a file called CSVFileLoader.cpp. This class must have the following structure:
Private Members
Data Type Name Description
boolean cFileReadSuccessful This member will indicate if the file-read operation was successful.
Private Methods
Return Type Method Signature Description
int determineNumberOfColumns(string fileName) This method must determine the number of columns in the file.
Insert a debug instruction that will display the number of columns as the
method exits.
void splitData(string line, TUTCell data[]) This method must split the line into separate elements and store each
element in the data[] array.
Insert a debug instruction that will display the data content of each element
as it is inserted into data[] array.
Public Methods
Return Type Method Signature Description
TUTTable loadFile(string fileName, string subjectCode) This method must load the data of the file into a table object. Only students
with the same subject code as indicated by the subjectCode input argument
may be added to this table. At the completion of this method it must return
the populated table.
Hint: Make use of the determineNumberOfColumns() and splitData() methods
in this method.
At the beginning and end of this method insert similar debug instructions as
those in the copy constructor of the TUTTable class. Also insert a debug
instruction that will display the content of each line as it is read from the CSV
file.
boolean readSuccessful() This method must indicate if the read process was completed successfully by
returning true or false.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning