Question
C++ 2D Array Help I am having trouble with a C++ 2d array. Will rate all helpful solution thumbs up. Thank you! Question: Assumption: -
C++ 2D Array Help
I am having trouble with a C++ 2d array. Will rate all helpful solution thumbs up. Thank you!
Question:
Assumption:
- There is at least one value in the file, no more than 10 values in one line, and no more than 10 lines.
Requirements:
Example output:
My code (menu is functional):
#include
#include
#define SIZE 10
using namespace std;
void printarray();
void readFile();
void incrementOne();
void decrementOne();
void addValue();
int main(int argc, char *argv[])
{
ifstream inf(argv[1]);
double data[SIZE][SIZE];
int option = 0;
bool loop = true;
readFile();
while (loop = true)
{
cout
cout
cout
cout
cout
cin >> option;
switch (option)
{
case 1: //Incerement all values by 1
incrementOne();
printarray();
break;
case 2: //Decrement all values by 1
decrementOne();
printarray();
break;
case 3: //Add value to entire array
addValue();
printarray();
break;
case 4: //Exit
return 0;
}
}
return 0;
}
void readFile()
{
}
void printarray()
{
}
void incrementOne()
{
}
void decrementOne()
{
}
void addValue()
{
}
Suppose floating-point values exists in a file as such 3.3 1.1 8.22 6.45 2.1 3 5 7 We would like to read these values into a two-dimensional array and manipulate them in the following ways: 1) Increment each value by 1 2) Decrement each value by 1 3) Add a specific floating-point value to each valueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started