Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* Method one2TwoD: (Problem 2) 10 pts * Given a ld array of integers A, you are to produce (and return) a 2D array B

image text in transcribedimage text in transcribed

/* Method one2TwoD: (Problem 2) 10 pts * Given a ld array of integers A, you are to produce (and return) a 2D array B of integers that is as follows: B has as many rows as A.length B has as many columns as A.length B contains only values o except for its diagonal elements: for all elements B[i][i], we have B[i][i] = A[i]. * Note: you get bonus points when you implement this method using only one for loop. -- 3 pts */ public int[][] one2TwoD(int[] A) { int[][] B = new int[1][1]; // to be modified of course :) return ""; } /* Method one2TwoDMulti: (Problem 3) 10 pts * Given a ld array of integers A, you are to produce (and return) a 2D array B of positive integers that is as follows: B has as many rows as A.length Each ith row of B is of length A[i] and contains only values A[i] public int[][] one2TwoDMulti(int[] A) { int[] [] B = new int[1][1]; // to be modified of course :) return B; } /* Method string2Array: (Problem 4) 10 pts * Given a string str, you are to produce (and return) a ld array s of strings of length = the length of str, * and where each element S[i] = str.substring(0,1+1). */ public String[] string2Array(String str) { String[] $ = new String[1]; // to be modified of course :) return s; } /******For testing one2TwoD int[] z = {1, 2, 5, 3}; int[][] B testing.one2TwoD(z); for (int i 0; i

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

Students also viewed these Databases questions

Question

Prepare a short profile of Henry words worth Longfellow?

Answered: 1 week ago

Question

What is RAM as far as telecommunication is concerned?

Answered: 1 week ago

Question

Question 1: What is reproductive system? Question 2: What is Semen?

Answered: 1 week ago

Question

Describe the sources of long term financing.

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago