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
Rus_ich [418]
3 years ago
10

Write an application that creates a two-dimensional array. Allow the user to input the size of the array (number of rows and num

ber of columns). Fill the array with random numbers between 0 and 100. Search the array for the largest value. Display the array values, numbers aligned, and the indexes where the largest value is stored.
Computers and Technology
1 answer:
Sindrei [870]3 years ago
4 0

Answer:

Explanation:

The Program can be computed as follows:

/*********************************************************

*Program that creates a two-dimensional array and takes an*

*Input as a size of an array and generate random elements *

**********************************************************\

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace ConsoleApplication 1

{

class Program

{

static void Main(string[] args)

{

int maxi=0, maxj=0;

//Random for create a random numbers.

Random rnd = new Random();

Console.WriteLine ("Enter the number of +"rows... ");

//Take a row number as a input.

int rows=Convert .Tolnt32 (Console.ReadLine

());

Console .WriteLine ("Enter the number of +

"columns ...");

//Take a column number as a input.

int cols=Convert.Tolnt32 (Console .ReadLine

());

//Declaring a two-dimensional array.

int[,] randarray = new int[rows,cols ];

//Creating an array with the random numbers.

for (int i = 0; i < rows; i++)  

{

for (int j = 0; j < cots; j++) {

//Random numbers.

randarray[i, j] = rnd.Next(0, 100);

}

}

//Assign first element of an array to the max

//Variable

int max = randarray[0,0];

//Display the elements in two-dimensional

//array

for (int i = 0; i < rows; i++)

{

for (int j = 0; j < cols; j++)  

{

Console.Write('\n[" + i + "," +j + "]"

+"\t");

Console.Write(randarray[i, j]);

}

Console.WriteLine("\n");

}

//Checking the largest element in two-

//dimensional array.

for (int = 0; i < rows; i++)  

{  

for (int j 0; j < cols; j++)

if (randarray[i, j] > max)

{

max = randarray[i, j];  

maxi = i;

maxj = j;

}

}

}

Console.WriteLine("The largest value is stored"

+"at ["+maxi+","+maxj+"]"+max);

Console.Read();

}

}

}  

Sample Output:

Enter the number of rows.....

2

Enter the number of columns

6

[0,0] 57

[0,1] 71

[0,2] 61

[0,3] 31

[0,4] 77

[0,5] 35

[1,0] 32

[1,1] 73

[1,2] 61

[1,3] 28

[1,4] 92

[1,5] 98

The largest value is stored at [1,5] 98

You might be interested in
Read each of the following statements about Computer Science and explain why you think that statement is true.
larisa86 [58]

Answer:

sytaragadr

Explanation:

3 0
3 years ago
What is the difference between chrome and chromium browser?
olga_2 [115]
Have minor differences in features, logos, & licensing
8 0
4 years ago
An ip address in the address range 169.254.x.y, used by a computer when it cannot successfully lease an ip address from a dhcp s
Georgia [21]
Yes that is the correct answer


5 0
4 years ago
State whether true or false.
Rufina [12.5K]
True. hope this helped!!
7 0
4 years ago
What formula would you enter in c4 that combines a4 and b4 to get a result like c2
Paul [167]

Available options

=A4&&B4

=A4&" "&B4

="A4"&""&"34"

=A4&""&B4

Answer:

=A4&""&B4

Explanation:

In a Microsoft Excel spreadsheet, to combine the content of two cells into another cell, a user will have to use the command &

Hence, in this case, given that there is no need to have any character or blank space in between the content of the starging cells, which is just A4 and B4, then we have the following technique

1. Select the cell C2

2. Input the command = or +, then select cell A4

3. Input the command &

4. Then select the cell B4

5. Click enter.

Therefore, the answer should appear as =A4&B4.

But from the available options, there is nothing like that, so we pick =A4&""&B4 because it gives the same outcome.

6 0
3 years ago
Other questions:
  • Write a program that defines a type for a structure that stores information on a student in ENG EK 125. Declare two variables to
    8·1 answer
  • For a panoramic photograph, you will more than likely want to control the exposure of the photograph yourself rather than lettin
    11·1 answer
  • Here are the codes for producer and consumer problems.
    10·1 answer
  • What at some advantages of creating a powerpoint?
    9·1 answer
  • What Is the output of the following: =OR (5 &lt;7, 16*Rand ()&gt;23,FALSE)
    5·1 answer
  • When entering a formula or function into a cell, most spreadsheet programs require that you begin with some type of symbol, usua
    5·1 answer
  • Jason is computer professional who has access to sensitive information. He shares this information with another organization in
    7·2 answers
  • Write a function named sortie that takes three integer parameters by reference and rearranges them in ascending order--the first
    6·1 answer
  • What is the biggest difference between single system recording and double system recording?
    8·1 answer
  • Does anyone know? If you do please answer.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!