Question: * ? ? * State of the program * ? ? * : mat.cpp #include #include #include using namespace std; / / the following can
State of the program :
mat.cpp
#include
#include
#include
using namespace std;
the following can be changed and the rest of the code should work
int const R ; number of rows
int const C ; number of columns
int const VM ; table entry vector length
vector TRC; rows and columns table for now
Functions
int convertchar x
do a formula to convert m to n to o to etc.
int readTable
int row, col; row and col numbers
char colc; column indicator
ifstream fin linestxt ios::in;
Read in the file into T
while fin row next line of file
fin colc; col convertcolc; convert to a slot number
vector v; a vector to fill
char c; one char from the file
Fill v with chars from the file there are VM chars
Put v in Trowcol
end of while
Displays a vector or if the vector is empty
void showVectorvector v
if vsize empty entry
for int i ; i VM; i cout ;
else
show the content of v separated by blanks egm n o
Displays T as a table, separating entries with
void displayTable
display T nicely labeled with row numbers col numbers not needed
by calling showVector
Driver
int main
cout "Reading table from lines.txt endl;
readTable;
displayTable;
the end
lines.txt
m m n o
n p q r
o s t u
p v w x
test
Reading table from lines.txt
m n o p q r
s t u v w x
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
