Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA PLEASE Question 11 40 pts Program a class as depicted below, with the main function. public class Array public static void main(Stringll args) l
JAVA PLEASE
Question 11 40 pts Program a class as depicted below, with the main function. public class Array public static void main(Stringll args) l 12) Instructions: Provide code for each section from 1) to 12) as outlined in the instructions listed in section 1 to 12 below. In your program, consider a two-dimensional integer array referred to as t. 1. 13 points] Write code to prompt the user to input the number of rows and columns for this array t 2. [3 points] Write a statement that declares and creates t (using rows and cols from step 1.). 3. [3 points] Print out how many elements does t have 4. [2 points] Write a single statement that sets the element of t in row O and column 1 to zero. 5. 13 points] Write a nested for statement that initializes each element of t to zero. 6. [3 points] Write a nested for statement that inputs the values for the elements of t from the user 7. [3 points] Write a series of statements that determines and displays the smallest value in t. 8. [3 points] Write a single printf statement that displays the elements of the first row of t. 9. 13 points] Write a statement that totals the first 2 elements of the third column of t. Do not use iteration. 10. [6 points] Write a series of statements that displays the contents of t in tabular format. List the column indices as headings across the top, and list the row indices at the left of each row 11. [3 points] Write a method, call it sum, that returns the sum of any two elements of the array t passed in as parameters. 12. [5 points] Using the return value of "sum" from step 11 above, write a switch statement that tests the sum's return value and displays day of the week starting with O for SUNDAY, 1 for Monday and the rest of the weekdays accordingly. Any number above 6 should display "Day invalidStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started