Dont advertise or spam! Only comment if you have full answer *******************
ID: 3542467 • Letter: D
Question
Dont advertise or spam! Only comment if you have full answer
*****************************************************************************************************************************************
******************************************************************************************************************************************
Explanation / Answer
#include "DynamicReader.h"
#include <iostream>
#include <cstdlib>
#include <STL>
using namespace std;
DynamicReader::DynamicReader() {
dimensions = 1;
oneDArray = NULL;
readSize = 0;
twoDArray = NULL;
nRows = 0;
nCols = 0;
readFileName = "";
writeFileName = "";
askedFileNames = false;
}
// REMEMBER TO CLEAN UP/DEALLOCATE THE ARRAYS!
DynamicReader::~DynamicReader() {
}
// THIS FUNCTION IS SOMETHING YOU HAVE IMPLEMENTED ALREADY
bool DynamicReader::open_IO(){
}
// THIS FUNCTION IS SOMETHING YOU HAVE IMPLEMENTED ALREADY
void DynamicReader::close_IO() {
}
/*--------------------------------------------------------------
This function asks the user for the filenames. This operation is
placed in a separate function because it is called multiple
times. Although it is awkward, ask the user for the dimensions of
the data structure in this function as well.
--------------------------------------------------------------*/
void DynamicReader::ask_filenames() {
cout << "Welcome. Please type in the name of the file to read the numbers. ";
cin >> readFileName;
cout << "Thank you. Please type in the name of the file to write the numbers. ";
cin >> writeFileName;
askedFileNames = true;
cout << "What are the dimensions of this data structure? ";
cin >> dimensions;
}
bool DynamicReader::read_1D_array(istream &in, string readFile) {
return true;
}
bool DynamicReader::read_2D_array(ostream &out, string writeFile) {
return true;
}
/*--------------------------------------------------------------
write_array() writes the array into the file with the name
writeFileName.
precondition: The output file is open, and nothing has been
written to the file before.
Remember that the output should have the same format as the
input.
--------------------------------------------------------------*/
// TAKE A LOOK AT THE read_array() FUNCTION IN THE HEADER FILE FOR HOW
// TO HANDLE THE DIFFERENCE BETWEEN 1D and 2D ARRAYS.
bool DynamicReader::write_array() {
}
ostream& operator << ( ostream& outs, DynamicReader& me ) {
return outs;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.