Question: I have the same question as this one below. https://www.chegg.com/homework-help/questions-and-answers/exercise-completed-individual-may-collaborate-anyone-else-complete-exercise-find-following-q9170877 Here is my current code for readData and I need help with my void displayDataTable(double
I have the same question as this one below.
https://www.chegg.com/homework-help/questions-and-answers/exercise-completed-individual-may-collaborate-anyone-else-complete-exercise-find-following-q9170877
Here is my current code for readData and I need help with my void displayDataTable(double arr[], int i) function aswell..
#include
const int FILE_DOESNT_EXIST = 0x1000; const int FILE_EXIST_NOTRIPS = 0x2000; const int LESS_THAN_MAX = 0x3000; const int EXACTLY_MAX = 0x4000; const int MORE_THAN_MAX = 0x5000; const int INCOMPLETE_EOF = 0x6000; const int FAILED_VALUE_READ = 0x7000; const int NOT_PROPER_RANGE = 0x8000;
using namespace std;
int readData(char const * data, double arr[], int i) { double num1, num2, num3; int readAmnt = 3; int errorMask = 0; ifstream inputFile; inputFile.open(data);
//Check if file opened successfully. if(!inputFile.is_open()) errorMask |= FILE_DOESNT_EXIST; return errorMask;
//Read 3 values -> check for EOF on every value. //If 1 value fails, skip to the next set. //Test for input failure for every value. while(!inputFile.eof() && inputFile >> num1 >> num2 >> num3) { cout << num1 << " " << num2; }
}
void displayDataTable(double arr[], int i) {
}
int main() { int retCode = 0; double darray[30];
retCode = readData("text1.txt", darray, 10); cout << "Return code is :" << hex << retCode << endl; displayDataTable(darray, retCode&0xFF);
cin.get(); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
