Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 11 CSE 110: Principles of Programming Arizona State University Lab Authors: Ahmed Moussa and Ghaith Salman Topics Arrays with methods Two Dimensional (2D) Arrays

image text in transcribed

Lab 11 CSE 110: Principles of Programming Arizona State University Lab Authors: Ahmed Moussa and Ghaith Salman Topics Arrays with methods Two Dimensional (2D) Arrays Lab 11 - Arrays 1. Please copy the following code into your IDE and ensure it compiles. public class Labl1 public static void main(String[] args) int[] array= {-1,-1,-1,-1,-1,1,-1,-1,-1,1,-1); 2. Make a method to print an array that accepts the array and the length of the array as parameters. (Is the length necessary? If you want, modify your code to work without having to accept the length.) Test your method with the given array Make a method that accepts an array and a new element, which adds that element to the array. You want to go through the array until you find a -1, then replace the first -1 you run into with the new element. Return/print something appropriate if the array is full. Make a method that inserts a certain value to a specific index in the array (accepts array, new value, and index.) Check if index is within range before you attempt to insert it. Make a method that deletes the value of a specific index from the array (turn it back to -1) this one accepts the array, and index to delete. Check if index is within range before you attempt to delete the value in it. 3. 4. 5. 6. Create a 2D Array (10x10) where you will be storing values of type int, fill in the 7. Create a method that accepts a 2d array and prints it. 9. Please upload your Labl1.java file to the Lab 11 assignment under the Labs tab on elements of the 2d array by prompting the user for input. Blackboard. Make sure you talk to your lab TA before you leave to ensure they marked you as present

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_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago