My Courses & Academics - oakton.edu PROJECT DESCRIPTION Type, compile and run a computer program that...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
My Courses & Academics - oakton.edu PROJECT DESCRIPTION Type, compile and run a computer program that uses both arrays and methods with Searching and Sorting Techniques. Arrays, or subscripted variables, allow for variables, with common data types, to be grouped under one name. Methods assist in developing modular programs segments. Follow the provided instructions and use arrays and methods to search for data and sort the data. Basically, your program should perform these minimally required tasks: declare and populate an array of strings declare and populate a parallel array of integers perform searches on both arrays perform parallel processing using both arrays D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures display the arrays after some elements in the arrays have been updated accomplish sorts on both arrays These tasks will be outlined below in the steps for completion of this project. d2l.oakton.edu After you complete your program code, compile and run your program, observe the output and then modify the program. Some skeletal program code is shown in Figure 1, which follows. View as Page + Homework Help - Q&A from Online Tutors - Course Hero 00 My Courses & Academics - oakton.edu PROJECT Arrays and Methods with Java - Searching and Sorting Steps to Complete This Project An Insertion Sort, also known as a Bully Sort, is such that we take the elements from the list one at a time and insert them in their correct position into a new sorted list. STEP 1 Open an Integrated Development Environment (IDE) STEP 2 Write the Program Code Open Eclipse, Net Beans, VSCode, MS Visual Studio or similar programming text editor / compiler. Write the program code that will satisfy the requirements of this project. In a top-down fashion, construct the code statements with these specifications. Within your file, declare a Scanner class object that will be used for user input. import java.util.S D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures static Scanner sc = new Scanner(System.in); Declare an array of strings. Use a one-dimensional array with ten elements. String[] myClientsArray = new String[10]; Populate the array of strings using these client names. Client Names d2l.oakton.edu View as Page + Homework Help - Q&A from Online Tutors - Course Hero 00 My Courses & Academics - oakton.edu String[] myClientsArray = new String[10]; Populate the array of strings using these client names. Client Names Butler Samuels Bond Davis Joe Chang Baker Zheng Use this code construction for hard - coding the values of the string array. myClientsArray[0] = "Butler"; myClientsArray[1] = "Samuels"; myClientsArray[2] = "Bond"; Now declare an array of integers. Use a one-dimensional array with at most ten elements. int[] myClientNumbers = new int[10]; D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures Populate the array of integers using these client numbers. This integer array will be a parallel array to the string array, which holds the client names. PROJECT Arrays and Methods with Java - Searching and Sorting View as Page d2l.oakton.edu Homework Help - Q&A from Online Tutors - Course Hero 00 My Courses & Academics - oakton.edu public void linSearchString(String strArray[], String search) { int i = = 0; int flag = 0; for(i=0; i <10; i++) { if (search.equals(strArray[i])) { flag = 1; break; After populating the two arrays, you will now search the Client Names list or array of strings. Using a linear search method, such as that given below, implement the code to search for an element in the above list. In the main() method use a call to the linSearchString() method. } } if (flag "1 System.out.println("item found at position + (i + 1)); else = 1) System.out.println("item not found"); } d2l.oakton.edu D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures View as Page + Homework Help - Q&A from Online Tutors - Course Hero In a similar fashion, you will now search the Client Numbers list. Write and use a linSearchInt() method, whose code is to be comparable to the above method. 00 My Courses & Academics - oakton.edu PROJECT Arrays and Methods with Java - Searching and Sorting STEP 3 Build, Compile and Run the Program Compile and run your program code statements. Correct any syntax or compile errors. [ Sample Program Output ] STEP 4 Test the Program Once you have successfully compiled your parallel array program, test your program and search for both a client name and a client number. Observe the output in the Console window of your application. ********** Parallel Array Processing Application ********** Enter a Client Name -> Bond item found at position 3 Enter a Client Number -> 188 item found at position 3 D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures results: the positions MATCH d2l.oakton.edu View as Page Homework Help - Q&A from Online Tutors - Course Hero STEP 5 Verify Your Output When you enter the above information, the Console window should show your program output. Verify that the output is accurate and that the required output information is displayed. If necessary, use separate program runs to compare various input and output values. + STEP 6 Modify Your Program With both the original arrays still hardcoded as being unsorted, use parallel array processing logic and programming techniques to search for a client name and have the associated client number also displayed together as a paired entity in the search results. 00 My Courses & Academics - oakton.edu STEP 7 Re - Compile and Run the Program Once you have successfully compiled your modified program, ensure that your completed program runs successfully. D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures STEP 8 Verify Your Output When you enter the requested information, the Console window should show your program output. Verify that the output is numerically accurate and that the required output information is displayed. Again, use separate program runs to compare the output when different inputs are used. d2l.oakton.edu Of course, when you run your modified program, you will most likely be able to match Client Name with a Client Number but it will most unlikely that you will not be able to match the same name with the same number when it comes to your sorted arrays. This is what your program will illustrate. STEP 9 Submit Your Project Once you have determined that your modified program is satisfying this project's requirements, complete the submission process as follows: Open MS Word and type a heading for a new document that includes your full name, course number, lab number and date. Within the document paste a snapshot of your program code. Label your snapshot with a reasonable description. After the snapshot, paste the output that appears in your Console screen. Note - you can use the Windows Snipping Tool, which is part of the Windows Accessories Group, to easily capture your Console window. PROJECT Arrays and Methods with Java - Searching and Sorting View as Page ? Homework Help - Q&A from Online Tutors - Course Hero 00 My Courses & Academics - oakton.edu PROJECT DESCRIPTION Type, compile and run a computer program that uses both arrays and methods with Searching and Sorting Techniques. Arrays, or subscripted variables, allow for variables, with common data types, to be grouped under one name. Methods assist in developing modular programs segments. Follow the provided instructions and use arrays and methods to search for data and sort the data. Basically, your program should perform these minimally required tasks: declare and populate an array of strings declare and populate a parallel array of integers perform searches on both arrays perform parallel processing using both arrays D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures display the arrays after some elements in the arrays have been updated accomplish sorts on both arrays These tasks will be outlined below in the steps for completion of this project. d2l.oakton.edu After you complete your program code, compile and run your program, observe the output and then modify the program. Some skeletal program code is shown in Figure 1, which follows. View as Page + Homework Help - Q&A from Online Tutors - Course Hero 00 My Courses & Academics - oakton.edu PROJECT Arrays and Methods with Java - Searching and Sorting Steps to Complete This Project An Insertion Sort, also known as a Bully Sort, is such that we take the elements from the list one at a time and insert them in their correct position into a new sorted list. STEP 1 Open an Integrated Development Environment (IDE) STEP 2 Write the Program Code Open Eclipse, Net Beans, VSCode, MS Visual Studio or similar programming text editor / compiler. Write the program code that will satisfy the requirements of this project. In a top-down fashion, construct the code statements with these specifications. Within your file, declare a Scanner class object that will be used for user input. import java.util.S D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures static Scanner sc = new Scanner(System.in); Declare an array of strings. Use a one-dimensional array with ten elements. String[] myClientsArray = new String[10]; Populate the array of strings using these client names. Client Names d2l.oakton.edu View as Page + Homework Help - Q&A from Online Tutors - Course Hero 00 My Courses & Academics - oakton.edu String[] myClientsArray = new String[10]; Populate the array of strings using these client names. Client Names Butler Samuels Bond Davis Joe Chang Baker Zheng Use this code construction for hard - coding the values of the string array. myClientsArray[0] = "Butler"; myClientsArray[1] = "Samuels"; myClientsArray[2] = "Bond"; Now declare an array of integers. Use a one-dimensional array with at most ten elements. int[] myClientNumbers = new int[10]; D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures Populate the array of integers using these client numbers. This integer array will be a parallel array to the string array, which holds the client names. PROJECT Arrays and Methods with Java - Searching and Sorting View as Page d2l.oakton.edu Homework Help - Q&A from Online Tutors - Course Hero 00 My Courses & Academics - oakton.edu public void linSearchString(String strArray[], String search) { int i = = 0; int flag = 0; for(i=0; i <10; i++) { if (search.equals(strArray[i])) { flag = 1; break; After populating the two arrays, you will now search the Client Names list or array of strings. Using a linear search method, such as that given below, implement the code to search for an element in the above list. In the main() method use a call to the linSearchString() method. } } if (flag "1 System.out.println("item found at position + (i + 1)); else = 1) System.out.println("item not found"); } d2l.oakton.edu D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures View as Page + Homework Help - Q&A from Online Tutors - Course Hero In a similar fashion, you will now search the Client Numbers list. Write and use a linSearchInt() method, whose code is to be comparable to the above method. 00 My Courses & Academics - oakton.edu PROJECT Arrays and Methods with Java - Searching and Sorting STEP 3 Build, Compile and Run the Program Compile and run your program code statements. Correct any syntax or compile errors. [ Sample Program Output ] STEP 4 Test the Program Once you have successfully compiled your parallel array program, test your program and search for both a client name and a client number. Observe the output in the Console window of your application. ********** Parallel Array Processing Application ********** Enter a Client Name -> Bond item found at position 3 Enter a Client Number -> 188 item found at position 3 D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures results: the positions MATCH d2l.oakton.edu View as Page Homework Help - Q&A from Online Tutors - Course Hero STEP 5 Verify Your Output When you enter the above information, the Console window should show your program output. Verify that the output is accurate and that the required output information is displayed. If necessary, use separate program runs to compare various input and output values. + STEP 6 Modify Your Program With both the original arrays still hardcoded as being unsorted, use parallel array processing logic and programming techniques to search for a client name and have the associated client number also displayed together as a paired entity in the search results. 00 My Courses & Academics - oakton.edu STEP 7 Re - Compile and Run the Program Once you have successfully compiled your modified program, ensure that your completed program runs successfully. D2L CSC_241_LAB_04_2022 - CSC-241-0C1 - Java Data Structures STEP 8 Verify Your Output When you enter the requested information, the Console window should show your program output. Verify that the output is numerically accurate and that the required output information is displayed. Again, use separate program runs to compare the output when different inputs are used. d2l.oakton.edu Of course, when you run your modified program, you will most likely be able to match Client Name with a Client Number but it will most unlikely that you will not be able to match the same name with the same number when it comes to your sorted arrays. This is what your program will illustrate. STEP 9 Submit Your Project Once you have determined that your modified program is satisfying this project's requirements, complete the submission process as follows: Open MS Word and type a heading for a new document that includes your full name, course number, lab number and date. Within the document paste a snapshot of your program code. Label your snapshot with a reasonable description. After the snapshot, paste the output that appears in your Console screen. Note - you can use the Windows Snipping Tool, which is part of the Windows Accessories Group, to easily capture your Console window. PROJECT Arrays and Methods with Java - Searching and Sorting View as Page ? Homework Help - Q&A from Online Tutors - Course Hero 00
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class ClientSearch static Scanner sc new ScannerSystemin public static ... View the full answer
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
STEELCO manufactures two types of steel (steel 1 and steel 2) at two locations (plant 1 and plant 2). Three resources are needed to manufacture a ton of steel: iron, coal, and blast furnace time. The...
-
The cheetah (Acinonyx jubatus) is the fastest land mammal and is highly specialized to run down prey. The cheetah often exceeds speeds of 60 mph and, according to the online document "Cheetah...
-
Find dy/dx by implicit differentiation. x 2 + y 2 = 64
-
Refer to information in QS 21-14. Compute the overhead volume variance for November and classify it as favorable or unfavorable. Data From QS 21-14 AirPro Corp. reports the following for November....
-
Christie Levine is the manager of the Instant Paper Clip Office Supply Company in Louisville. The company attempts to gain an advantage over its competitors by providing quality customer service,...
-
You need your client to send you a copy of a paper receipt so that you can match it to a gas expense in their QuickBooks Online. You create a client request and add a screenshot of the expense entry...
-
What are the four kinds of resources?
-
Based on the scenario below, you will complete a Balance Sheet. Read the scenario. Identify pertinent information and use it to fill in numbers on the Balance Sheet below. Not all information may be...
-
In relation to employment law, explain each of the following: a) The grounds upon which dismissal may be fair b) The test adopted by the courts when considering the grant of a mandatory interlocutory...
-
Suppose that a fast food restaurant, Jack McKing's opens a restaurant just off of an interstate highway exit where there are no other restaurants within 70 miles. Which market model best describes...
-
Consider the following rent roll for a 60-unit apartment building. If the average vacancy on similar properties is 6.5%, estimate the property's Effective Gross Rent. Avg. Rent/SF Unit Type # of...
-
The demand for a seasonal retail product is estimated to be uniformly distributed between 100 and 300 units. The procurement cost is $10 per unit and the sales revenue is $50 per unit. Units unsold...
-
(a) Describe the major steps for a CPU to execute a procedure call. Specify when BL and BR instructions will be executed, respectively. < (b) Explain how inline function can improve the software...
-
Consider the rotational fine structure of CuH (a) Draw the molecular orbital diagram for CuH for both electronic states. (b) Explain the different transitions that these lines correspond to (the...
-
Review Exhibit 11.4. Analyze each product on the graph according to the characteristics that influence the rate of adoption. For example, what can you conclude from the data about the relative...
-
The Quill Electric Company has recently installed a new computer system that has online, real- time capability. Terminals are used for data entry and inquiry. A new cash receipts and accounts...
-
Identify the three general types of evidence that might be collected during a fraud investigation.
-
A medium- sized grocery store has point- of- sale cash registers. The cash registers automatically summarize sales of all items sold in the store. One major problem facing the store is that of...
-
In the case considered in the question (14), show what the trajectory corresponds to in case the magnitude of acceleration is \(a=2 k \sqrt{1+\frac{t}{T}}\), where \(T=\) cost. Question 14 A particle...
-
The position vector along a trajectory expressed in terms of the scalar distance \(s\) from the origin is given by the relation \(\mathbf{r}=\mathbf{a} s^{2}+\mathbf{b} s+\mathbf{c}\), with the...
-
A particle is constrained to move on a circular guideway of radius \(R=3.00 \mathrm{~m}\), on which it can slide without friction, according to the motion equation law \(s(t)=k t^{3}\), with \(k=2.0...
Study smarter with the SolutionInn App