Lab 1 - Debugging New

docx

School

Fanshawe College *

*We aren’t endorsed by this school

Course

6067

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

3

Uploaded by DeaconPartridgePerson951

Report
INFO 6067 Testing for Development Lab Week 2 Student Names: Students group: Description – Debugging Read in a list of integers from standard input and print out in sorted order in ascending and descending order. % java BubbleSort Please enter a value to the list for sorting [-1 to quit]:114 Please enter a value to the list for sorting [-1 to quit]:27 Please enter a value to the list for sorting [-1 to quit]:21 Please enter a value to the list for sorting [-1 to quit]:99 Please enter a value to the list for sorting [-1 to quit]:-1 Let's Sort Iteration 1: [27, 21, 99, 114] Iteration 2: [21, 27, 99, 114] Iteration 3: [21, 27, 99, 114] ============ Ascending Order result:[21, 27, 99, 114] Iteration 1: [27, 99, 114, 21] Iteration 2: [99, 114, 27, 21] Iteration 3: [114, 99, 27, 21] ============ Descending Order result:[114, 99, 27, 21] Marks - 20 I NSTRUCTIONS Create a new project in Eclipse. Import the file. -BubbleSort.java Compile and run. Your output should look like the example above. DO NOT REFORMAT THE CODE. KEEP THE SAME FORMAT. DO NOT ADD AN NEW WHITE LINE OR REMOVE ANY WHITE LINE OR ELSE SOME OF YOUR ANSWERS BELOW WILL BE WRONG. Q1. Page 1 of 3
1. When you run the program, what is your output? (Copy and paste your output before making any changes to code ). 2. In short, tell me what is wrong with the output. (4 mark) INFO 6067 Testing for Development Lab Week 2 Correct the issues. The class must compile with no errors and no warnings once you are complete. 1. Which line is causing the exception ? (1 mark) 2. Simply provide your 1 line of code that fix this exception. (Copy and paste or type it) (1 mark) 3. Which line raises the warning? (Java helps you find this) (0.5 mark) 4. Simply provide your 1 line of code that fixes this warning, after you answer question 8. (Copy and paste or type it) (1 mark) 5. Go to the debugger, and set an appropriate condition to your breakpoint to stop in the ascending sort. You can set the condition to stop anywhere. Take a screenshot that includes the condition and the breakpoint line. (2 mark) 6. The ascending sort is broken. At which line of code causes it to break? (2 mark) 7. Provide the solution to the fix. (Copy and paste or type it in here) (1 mark) Page 2 of 3
8. The descending function is broken. At which line s of code is it broken? (2.5 mark) 9. Provide the code s that fixes this. (4 mark) 10. Provide a screenshot of the Java console after completing all the questions (1 mark) 11. With the knowledge you now have, what can you do to check if either algorithm is sorted properly with assertion? Provide a small code snippet below. (2 mark) Marks Available What Are the Marks Awarded For? Marks Awarde d 5 What’s Wrong Question 3 Exception Question 3 Warning Questions 11 Logic Issues 22 TOTAL MARKS Upload your completed lab document (Renamed to LastName_FirstName_Lab_1.docx’ ) to the drop box “Lab 1 - Debugging”. (Due Date Available on FoL Dropbox) Page 3 of 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help