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
Phân tích cạnh tranh của cocacola và pepsi
Fittoniya [83]
I don’t understand please speak English
7 0
2 years ago
What's the inputs and outputs in a kitchen?
SashulF [63]
I really don't know...
6 0
3 years ago
how do you set up a slide show to play continuously, advancing through all slides without requiring your interaction? A. Click S
Archy [21]

Answer:

B. Click Set Up, Slide Show, and then select the Loop continously until 'Esc' and use timings, if present options.

Explanation:

PowerPoint presentation is a program which was developed by Microsoft. It is a platform which is used to create business presentation or educational presentations, etc.

In order to play the slide show continuously without our interaction, we need to do the following steps :

1. In the powerpoint presentation, we have to click  "Slide Show" tab in the ribbon and then click on the "Set up slide show" on the Set Up bar.

2. The set up slide show dialogue box will pop up. In this we have to  check or tick on the "Loop continuously until 'Esc' " in the "Show Option" and then click 'OK'

3. Now in the "Slides" preview side panel, we have to click the 1st slide , then Press and hold the 'Shift' key and then click the last slide. This selects all the slides.

4. Now, in the transition tab, in the "Timing" group, we have or uncheck or untick the " On Mouse Click " and also check the " After"

6 0
3 years ago
Chemical equations of Carbon + water​
Setler79 [48]

Answer:

Aqueous carbon dioxide, CO2 (aq), reacts with water forming carbonic acid, H2CO3 (aq). Carbonic acid may loose protons to form bicarbonate, HCO3- , and carbonate, CO32-. In this case the proton is liberated to the water, decreasing pH. The complex chemical equilibria are described using two acid equilibrium equations.

PLS MARK AS BRAINLIEST

8 0
3 years ago
It is a good idea to include your teacher’s name on a title page.
kkurt [141]
I usually include my teachers name in the upper right hand corner along with the date my name and the subject.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Select all examples of proper keyboarding technique.
    15·2 answers
  • When you set the position property for a block element to fixed, the element
    5·1 answer
  • What do you believe are the motives of a cyber criminal? Why?
    15·1 answer
  • Help, please!! A file named "games.txt" exists and has 80 lines of data. You open the file with the following line of code. aFil
    6·1 answer
  • PLEASE PLEASE PLEASE PLEASE PLEASE HELP! I'M BEGGING Y'ALL! I NEED THIS FOR TODAY! CORRECT ANSWERS WILL BE AWARDED BRAINLIEST!
    6·1 answer
  • When compared to defender and analyzer firms, early adopters of new technologies tend to be?
    13·2 answers
  • In what stage of an algae or fungi life cycle are they able to reproduce spores?
    10·1 answer
  • B) The company's chief financial officer recognizes the need for an upgrade to the smart watches, but does not understand why th
    8·1 answer
  • A user generates printouts consisting of several pages of seemingly random characters every time he prints to a network printer.
    5·1 answer
  • Ninety percent of the fastest-growing jobs require some kind of postsecondary education.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!