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]
2 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]2 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
Help! Picture provided
natka813 [3]
The answer is c
hope this helps
7 0
2 years ago
Read 2 more answers
When an architect designs a building, what visual design elements could be used to help capture a viewer’s attention? A) The use
Salsk061 [2.6K]
The correct answer is A
6 0
2 years ago
Read 2 more answers
Assume you are using the text's array-based queue and have just instantiated a queue of capacity 10. You enqueue 5 elements and
Anika [276]

Full question:

Assume you are using the text's array-based queue and have just instantiated a queue of capacity 10. You enqueue 5 elements and then deque 2 elements. Which indices of the internal array elements hold the remaining elements? a) 0 to 2 b) 7 to 9 c) 2 to 4 d) 1 to 3

Answer and Explanation:

If you instantiate a capacity of 10 for the queue, you have the queue a capacity of not more than 10 values.

To enqueue means to add an element to the array(if it's not full, n<10)

To dequeue means to delete an element from the array or queue(if n! =0)

From the question, for example:

We create a queue of capacity 10:

Queue q(10);

We add elements/enqueue 5 elements to the queue :

q.queueEnqueue(10);

q.queueEnqueue(5);

q.queueEnqueue(8);

q.queueEnqueue(9);

q.queueEnqueue(2);

If we print this out:

q. queueDisplay()

We would get:

10, 5, 8, 9, 2

We remove elements/dequeue 2 elements from the queue :

q. queuedequeue();

q. queuedequeue();

We print it out:

q. queueDisplay()

8 ,9, 2

We observe that deletion/dequeue starts from the front/first index.

We are left with indices 2, 3, 4 or 2 to 4

Note: the above methods/ functions and objects used are merely for example purposes. The queue uses a floating front design approach.

7 0
3 years ago
Which type of loan is based on financial need
Pani-rosa [81]

Answer:

Direct Subsidized Loans are based on financial need.

hope my ans helps

be sure to follow me

pls give brainlist to my answer

stay safe

have a good day

8 0
2 years ago
What is often called a platform, a collection of computer programs that work together to manage hardware and software to ensure
Nady [450]

Answer:

The correct answer to the following question will be "Operating system".

Explanation:

  • An operating system is a machine software that handles hardware of a computer, computing assets and delivers basic services to software programs.
  • It is an intermediary between such users and computer hardware.
  • It also helps you to interact with your machine without learning how to use your language of the computer.

Therefore, it will be the right answer.

7 0
2 years ago
Other questions:
  • Proxy data:
    12·1 answer
  • What is the maximum amount that OSHA can impose as a penalty on an employer for each Willful violation?
    11·1 answer
  • Why is television reactive, requiring no skills or thinking
    11·1 answer
  • An ISP is considering adding additional redundant connections to its network. Which of
    5·1 answer
  • Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both sing
    10·1 answer
  • Computers help eliminate the repetitiveness of manual tasks. How can this benefit you in your overall career?
    9·2 answers
  • You are asked to check your company’s configurations to determine if any filters should be built to stop certain ICMPv6 traffic.
    9·1 answer
  • Which statements about editing an existing Contact in Outlook are true? Check all that apply.
    9·2 answers
  • Guidewords for the word “serpent” may be
    8·2 answers
  • Non linear editing can cause _____ where edit and re-edit and re-edit again can cause video to be less true than the original ma
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!