Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answers should be formatted to JAVA. Please focus on solving lab questions 5-10 As I'm sure that I'll be able to solve everything else without
Answers should be formatted to JAVA. Please focus on solving lab questions 5-10 As I'm sure that I'll be able to solve everything else without any issues.
Objective: Write a program that creates two matrices of whole numbers and then subtracts them! [4,18,7][1,32,4]=[41,1382,74]=[3,26,3] Lab Solution Requirements: - Functionality. (80pts) - No Syntax, Major Run-Time, or Major Logic Errors. (80pts*) - "Code that cannot be compiled due to syntax errors is nonfunctional code and will receive no points for this entire section - *Code that cannot be executed or tested due to major run-time or logic errors is nonfunctional code and will receive no points for this entire section - Only use Arrays to represent the Matrices (80pts*) - *Any other data structure such as LinkedLists, ArrayLists, etc. will result in no points awarded for this entire section. Creating the Matrices. (20pts) - We assume that our matrices only have only two dimensions (a 2D Amray) - Users must be able to specify the sizes of each Matrix - both length and width of both. - All the above must apply for full eredit. - Populating the Matrices. (20pts) - Users must be prompted to enter the individual values of each matrix (called components). - They must be prompted value's position (the indices) is being entered. - All the above must apply for full credit. - Subtracting the Matrices. (20pts) - The program must create a resulting matrix that is the same length and width. - The program must subtract the values component wise and stere the results in the resulting matrix. - Example. If we assume we have two matrices, A and B, and a resulting matrix C, then C[0][0]=A[0][0]B[0][0],C[0][1]=A[0][1]B[0][1], etc. - All the above must apply for full credit. - Printing the Results. (20pts) - The contents of both matrices entered by the user and the contents of the resulting matrix must be shown to the user. - Components of each should be shown in their appropriate rows and columns. - All the above must apply for full credit. - Coding Style. (10pts) - Readable Code - Meaningful identifiers for data and methods. - Proper indentation that clearly identifies statements within the body of a class, a method, a branching statement, a loop statement, etc. - All the above must apply for full credit. - Comments. (10pts) Your name in the file. (5pts) At least 5 meaningful comments in addition to your name. These must describe the function of the code it is near. (5pts) Example Dialog: Welcome to the matrix subtractor program! please enter the length and width of the first matrix 2 2 Enter value at index 00 4 Enter value at index 01 1 Enter value at index 10 8 Enter value at index 11 7 Please enter the length and width of the second matrix 1. Create a section named "Problem" and describe this lab's problem in your own words. (10pts). 2. Create a section named "Solution Description" and describe how the code solves the problem in your own words. (10pts). 3. Create a section named "Problems Encountered" and describe the various syntax, run-time, and logic errors that were encountered while implementing the solution. (10pts). 4. Draw a flow chart of the solution and include that in the proposed solution section 5. Is it possible to have "ragged" / "jagged" arrays in Java? 6. Given the following code snippet, are there any kind of errors? If so, name the types, where, and how this code can be fixed. Otherwise, what does this code exactly print to the console? 7. Given the following code snippet, are there any kind of errors? If so, name the types, where, and how this code can be fixed. Otherwise, what does this code exactly print to the console? 8. Given the following code snippet, are there any kind of errors? If so, name the types, where, and how this code can be fixed. Otherwise, what does this code exactly print to the console? 9. Given the following code snippet, are there any kind of errors? If so, name the types, where, and how this code can be fixed. Otherwise, what does this code exactly print to the console? int [][]w={{1,2,3,4},{3,2,1},{5,6,7,8,9},{2}}; for(int 1=0;1Step 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