Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2) 25+ points max of 30 avarded) In the following code, locate all the errors error, describ s that you can. For each error,

image text in transcribed
image text in transcribed
Question 2) 25+ points max of 30 avarded) In the following code, locate all the errors error, describ s that you can. For each error, clearly indicate the line in a corrected version of that line. For long lines of code, you caeetleast changes to the error, rather than the whole line. You should fix errors wi c in your own words what the cause/source of the error rrected version comments will help tell you what the program should the the fewest/least changes to the do. There is a program transcript below ou may assume that the comments do not contain errors source code, so that it should be clear what the program should Line # | Prog do ran Source Code: Located in a Eile named Progras 2 ayAutoResize will try to re-size it's internal arra / (named r // that is. Cur / Example: the array 1s //calls-SetAtIndex(500 Nums), if the user attempts to 'set' an element currently outside the bounds of the array ample: the array is 100 elements long, and the programmer lon - 11: The. SmartArrayAutoResize should attempt to allocate a new arra transfer over all the current data, then set slot T5001 This program should never crash (500] to be -1 class SmartArravAutoResize 10.- It-int_] rgNum_-null; / indenting is unusual but lega public void SetAt Index (int idx, int val) 12 1 idx rgNums. Length intl] tempArray-new int (idx)a for (int -0:

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

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions