Guess2.java: Run the above-referenced program and watch how it behaves. You could probably debug it by view but use the methods above to find the bugs. These bugs will be harder to find then the previous. 32. Take a moment to determine how you wish to approach debugging this program. 33. Utilize the variety of tools that have been discussed in this lesson. 34. Take screen shots of the errors you found and add them to the Word document. 35. Take screen shots of the final working code. 36. Include what features of Eclipse's debugger you use to find the errors in the Word document.
Added by Jose V.
Step 1
java` program using Eclipse's debugger and other tools. Show more…
Show all steps
Your feedback will help us improve your experience
Carson Merrill and 78 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Redo Problems 29-44 on a computer and compare your answers with those you get by hand.
The Derivative
Rules for Finding Derivatives
Here is what I would like you to do for the Scheduling Simulator: Review the MOSS Scheduling Simulator documentation. Download and install the self-extracting ZIP archive (sched.exe) into the folder you just created. If you have any difficulty downloading this file, you may also download it directly from ontko.com. Compile and run the scheduling simulation. For the scheduling simulation, implement another scheduling algorithm, First in Last out. To achieve this goal, you shall: Read and decipher the simulation program. Identify the function (submodule) that implemented the algorithm. Then you can choose to replace the function with a new algorithm, or you can develop a new function. For the second option, you will need to change the other parts of the program so that this new function is called and produces the desired result. Here is what I would like you to do for the Deadlocking Simulator: Review the MOSS Deadlock Simulator documentation. Download and install the self-extracting ZIP archive (deadlock.exe) into the folder you just created. If you have any difficulty downloading this file, you may also download it directly from ontko.com. Compile and run the deadlock simulation. There are two additional process command files ("b0.dat" and "b1.dat") in the distribution. Run the deadlock simulator with this command: java deadlock b 2 1 1. What happens? Now try this: java deadlock b 2 1 2. Why does the first command result in a deadlock but the second does not? Explain your answer in terms of what is going on in the process command files, b0.dat and b1.dat. Once you have finished compiling and running the scheduling and deadlock simulators, I would like you to complete and turn in the following (deliverables) in the form of a written document: All the files for the scheduling simulation that are changed. Documentation that briefly explains the changes that you made to item 4 of the MOSS Scheduling Simulation. A detailed answer to item 4 of the MOSS Deadlock Simulator.
Akash M.
Java: Write an application that has an array of at least 20 integers. It should call a method that uses the sequential search algorithm to locate one of the values. The method should keep a count of the number of comparisons it makes until it finds the value. Then the program should call another method that uses the binary search algorithm to locate the same value. It should also keep count of the number of comparisons it makes. Display these values on the screen. a. Create an array of 20 random integers. b. Use the Bubble Sort Algorithm to sort this array in an ascending order. c. Make a copy of this sorted array for use in the Binary Search method, using the array copy method called CopyArrayExample.java. e. Print out the array before starting the search so that you will know which integer you want the two search methods to search for. f. Run the Sequential Search algorithm and report the number of comparisons. g. Run the Binary Search algorithm and report the number of comparisons. CopyArrayExample.java: public class CopyArrayExample { public static void main(String args[]){ int a[]={10,20,30,40,50}; int b[]=new int[a.length]; //copying one array to another for(int i=0;i<a.length;++i){ b[i]=a[i]; } //printing array for(int i=0;i<b.length;++i){ System.out.print(b[i]+" "); } } }
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD