1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mamont248 [21]
3 years ago
14

(20 points). Some matrixes have very special patterns, for example, in the following matrix, the numbers in the first row are eq

ual to the number of their respective column; the numbers in the first column are equal to the square of the number of their respective row; when the row number equals to the column number, the elements are equal to 1; the rest elements are the sum of the element just above them and the one to their left. Write a user-defined function program in the program, you need to use while loops), and then use the function you write to create the following matrix (show the command you use). 1 4 9 16 2 1 10 26 3 4 1 27 4 5 8 13 9 22 1 23
Computers and Technology
1 answer:
Nostrana [21]3 years ago
3 0

Answer:

#include <iostream>

using namespace std;

void matrix(){

   int row = 5, col = 6;

   int myarr[row][col];

   for (int i = 0; i < 5; i++){

       for (int x = 0; x < 6; x++){

           if (i == 0){

               myarr[i][x] = (x+1)*(x+1);

          }else if ( x == 0){

               myarr[i][x] = (i+1)*(i+1)*(i+1);

           } else if ( i == x){

                myarr[i][x] = (i+1);

           } else{

                myarr[i][x] = myarr[i-1][x] + myarr[i][x-1];

           }

        }

   }

   for (int i = 0; i < 5; i++){

       for (int x = 0; x < 6; x++){

           cout<< myarr[i][x] << " ";

       }

       cout<< "\n";

}

}

int main(){

   matrix();

}

Explanation:

The C++ source code defines a two-dimensional array that has a fixed row and column length. The array is a local variable of the function "matrix" and the void function is called in the main program to output the items of the array.

You might be interested in
lenny joggy along a trail for 1.35 hours he ran at a pace of 3.2 miles per hour. how far did lenny jog?
Dmitriy789 [7]

Answer:

Lenny jogged along a trail for 1.35 hours. He ran at a pace of 3.2 miles per hour. How far did Lenny jog? Answer Lenny jogged 4.32 miles.

Explanation:

4 0
2 years ago
What can you use with your keyboards to narrow your search if you complete an Internet search using a search engine and do not g
pantera1 [17]
I'm pretty sure you would use A.) Quotation Marks.
Hope I helped!
3 0
3 years ago
When you select the data range for a pie chart, you should be sure to include the total cell on the worksheet?
Daniel [21]
This is not a question...
5 0
3 years ago
Terry came into work and turned on his computer. During the boot process, the computer shut down. When he tried again, the compu
Svetllana [295]

Answer:

SATA Cable

Explanation:

SATA (Serial Advanced Technology Attachment) Cable is a connection made between Computer hard drives and the motherboard. When a computer gives an error on startup that OS not found, there's a possibility that the drive containing the OS is not well connected to the motherboard. Making sure it is well connected to the motherboard will possibly fix the issue.

6 0
3 years ago
A search expression entered in one search engine will yield the same results when entered in a different search engine.
garik1379 [7]

Answer:

false

Explanation:

8 0
2 years ago
Other questions:
  • You have an insurance policy with a $300 premium and a $500 deductible. How much should you expect to pay the insurance company
    13·1 answer
  • Unlike the String class where you must pass a message to an object (instance) of the class, as in x.length( ), in order to use e
    12·1 answer
  • What is a DreamScape?<br> Explain <br> and give example (if you want)
    10·1 answer
  • A computer is an electronic device operating under the control of instructions stored in its own memory that can accept, manipul
    11·1 answer
  • Dividing a hard drive into multiple sections is known as partitioning
    5·1 answer
  • What made it possible to develop personal computers?
    10·2 answers
  • I need the answer ASAP. I’ll mark brainliest if right
    5·1 answer
  • The programming interface for a legacy motor controller accepts commands as binary strings of variable lengths.
    15·1 answer
  • What is the biggest difference between a movie and a game?
    12·1 answer
  • The computer-like model used to describe the way humans encode, store, and retrieve information is the ________ model.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!