Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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:

image text in transcribed

Example output:

image text in transcribed

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 value

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 15th International Conference Dasfaa 2010 Tsukuba Japan April 2010 Proceedings Part 1 Lncs 5981

Authors: Hiroyuki Kitagawa ,Yoshiharu Ishikawa ,Wenjie Li ,Chiemi Watanabe

2010th Edition

3642120253, 978-3642120251

More Books

Students also viewed these Databases questions

Question

Language in Context?

Answered: 1 week ago