Info
Warning
Danger
/ Homework Answers / Computer Science / Question Description: You must write a program which creates a two dimensional

Question : Question Description: You must write a program which creates a two dimensional

Question

Description:

You must write a program which creates a two dimensional integer array to represent a table with five rows and five columns.

Use loops to prompt the user to enter values for the first row and column.

Fill in the rest of the table with values calculated by summing the values in the table cell above and the table cell to the left of each cell. For example, suppose the user entered the following first row and column:

2

13

17

19

23

3

5

7

11

Then the completed table would have the following values:

2

13

17

19

23

3

16

33

52

75

5

21

54

106

181

7

28

82

188

369

11

39

121

309

678

Finally, you will print the table. Each row must be on a new line, and a space must be used between each table entry.

For the example above, the printed output should look like:

Implementation Details:

On the first line of your program file (.cpp file), place a comment with your name, EUID, and lab section number.

Inside the main function, you must:

Declare the two dimensional array.

Call a function which prompts the user to input each value for the first row and column of the table. The user should be prompted for each value entered.

Call a function which calculates values to fill the rest of the array using the strategy described in the description.

Call a function to print the array. Make sure the array is printed with each row on a separate line and a blank space in between consecutive entries on the same row (as shown in the description).

You must also write all functions (described above) which are called by the main function.

2

13

17

19

23

3

 

 

 

 

5

 

 

 

 

7

 

 

 

 

11

 

 

 

 

 

 

Solution
5 (1 Ratings )

Solved
Computer Science 6 Months Ago 6 Views
This Question has Been Answered!
Premium Content -

Unlimited Access

Explore More than 2 Million+
  • Textbook Solutions
  • Flashcards
  • Homework Answers
  • Documents
Signup for Better Grades!

Ask an Expert

Our Experts can answer your tough homework and study questions
154049 Computer Science Questions Answered!
Post a Question