Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# Code please with picture of code.Thanks! 1. Create a Main method, and create a 2D integer array called data , with a size of

C# Code please with picture of code.Thanks!

1. Create a Main method, and create a 2D integer array called data, with a size of five (5) by five (5). Ask the user to input the values for this array (Scanners nextInt)

  1. 2.Create a method called LongestPositiveSeries, that takes in a 2D array and finds the length of the longest continuous series of positive numbers in it. For example, if we had an array like this:

0

1

2

3

4

5

-1

-5

-5

5

3

-2

56

25

-15

0

5

5

0

324

46

25

0

0

0

    • The length would be 5. For this problem, 0 is considered non-negative and not positive, so we start counting from index [0, 1] (which is 1) to [1, 0] (which is 5) and end at index [1, 1] (which is 1).
    • Hint: Consider using a basic linear search and modifying it to keep track of the current positive streak of numbers.
  1. 3. Call that method in your Main, for the array data.
  2. 4. Print out the returned result from your method in your Main, along with the content of data.
  3. C# CODE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students also viewed these Databases questions

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago