YOUR CODE'S OUTPUT 1 did not compile/run! ----- 2 10 2 10 12 14 16 18 20 12 15 18 24 27 30 4 12 16 20 24 28 32 36 40 10 15 20 25 30 35 40 45 50 12 18 24 30 36 42 48 54 60 14 21 28 35 42 49 56 63 70 10 16 24 32 40 48 56 64 72 80 11 18 27 36 45 54 63 72 81 90 12 10 20 30 40 50 60 70 80 90 100 13 11 22 33 44 55 66 77 88 99 110 14 12 24 36 48 60 72 84 96 108 120 timeout: the monitored command dumped core 16 | ERROR 15 ] the program Aborted (core dumped) (SIGABRT) THE CORRECLOUTPUT OF THE TEST CAS

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Getting an error when I run my c++ code

The directions for the hw was to

Create a multiplication table:

row from 1 to 12

column from 1 to 10

First, populate the multiplication table using a 2D array.

Print out the contents of the multiplication table.

 

My code:

#include<iostream>                         

#include<iomanip>    //include for using setw

using namespace std;

 

//define a constant COL_SIZE

const int COL_SIZE = 10;

//  prototyping of the functions

void createTable(int array[][COL_SIZE], int rowSize);

void printTable (int array[][COL_SIZE], int rowSize, int columnWidth);

 

// the main method

int main()

{

    //define constants

    const int ROW_SIZE = 12;

    const int COL_WIDTH = 6;

   

    //define 2D array with rowssize= 12 and columnsize=10

    int multArray[ROW_SIZE] [COL_SIZE];

   

    //call the fuction createTable()

    createTable(multArray, ROW_SIZE);

   

    //call the function printTable()

    printTable(multArray, ROW_SIZE, COL_WIDTH);

        return 0;

}

//method for crating table

void createTable(int array[][COL_SIZE], int rowSize)

{

    //using nested for loop to create table

    for(int i=1;i<=rowSize;i++)

    {

        //inner for loop

        for(int j=1;j<=COL_SIZE;j++)

        {

        //multiply the numbers

        array[i][j]=i*j;

        }

    }

}

//define the method to print table

void printTable (int array[][COL_SIZE], int rowSize, int columnWidth)

{

   //printing the table using nested loop

    for(int i=1;i<=rowSize;i++)

    {

        //inner for loop

        for(int j=1;j<=COL_SIZE;j++)

        {

            //print the array elements

            cout<<setw(columnWidth)<<array[i][j];   //set the width using columnwidth and print the table

        }

    // for new line

    cout<<endl;

    }

   

}

Below I have attached the error I get 

YOUR CODE'S OUTPUT
1 did not compile/run!
-----
2
10
2
10
12
14
16
18
20
12
15
18
24
27
30
4
12
16
20
24
28
32
36
40
10
15
20
25
30
35
40
45
50
12
18
24
30
36
42
48
54
60
14
21
28
35
42
49
56
63
70
10
16
24
32
40
48
56
64
72
80
11
18
27
36
45
54
63
72
81
90
12
10
20
30
40
50
60
70
80
90
100
13
11
22
33
44
55
66
77
88
99
110
14
12
24
36
48
60
72
84
96
108
120
timeout: the monitored command dumped core
16 | ERROR
15
] the program Aborted (core dumped) (SIGABRT)
THE CORRECLOUTPUT OF THE TEST CAS
Transcribed Image Text:YOUR CODE'S OUTPUT 1 did not compile/run! ----- 2 10 2 10 12 14 16 18 20 12 15 18 24 27 30 4 12 16 20 24 28 32 36 40 10 15 20 25 30 35 40 45 50 12 18 24 30 36 42 48 54 60 14 21 28 35 42 49 56 63 70 10 16 24 32 40 48 56 64 72 80 11 18 27 36 45 54 63 72 81 90 12 10 20 30 40 50 60 70 80 90 100 13 11 22 33 44 55 66 77 88 99 110 14 12 24 36 48 60 72 84 96 108 120 timeout: the monitored command dumped core 16 | ERROR 15 ] the program Aborted (core dumped) (SIGABRT) THE CORRECLOUTPUT OF THE TEST CAS
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Randomized Select Algorithm
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education