Question: Assignment 5 will be way different. It will be more like what you will receive in a programming shop. By that I mean that some
Assignment 5 will be way different. It will be more like what you will receive in a programming shop. By that I mean that some things are built for you and others you will need to create or finish. P.S. part of your grade will include: Did you add in the required files? Did you rename your project? does your linear searches work? Did you put your code in the correct modules? did you change modules that you weren't supposed to? Build a program using what I gave you as a starting point.
- Do not add any modules; just use the ones I provide and add the code necessary to make it run
- Don't change any module names or the code in that module which has a comment block at the beginning which says "Finished - Don't alter!"
- You are required to add code and/or finish modules with a comment block at the beginning which says "Finish adding Code"
- The array has 10,000 integer elements and is filled for you by calling the module FillTheArray()
- The range of number that will fill the array is from 0 to 2500
- The array is unsorted, and a number may appear from 0 to many, many times
- Build 2 linear searches
- 1320 is just an integer value I selected which is between 0 and 2500
- The first linear search will check for the existence of the number 1320
- The second linear search will see how many of the number 1320 is actually exists in the array
- HINT: Because the function Random() is used to fill the array, the amount of the number 1320 will be different each time. This is why you need to validate your code and not just assume it is working correctly. This means you may need to build build your logic on a small array with known values in it and then apply it to the large array I have provided
- Output for the program will be simple and only states if 1320 exists or not in the array and then if it does, how many of them are there in the array
- Finish filling out the explanation in the Main() labeled "Array as an agreement comment:". What I'm asking for here is in this comment you to explain how the array is passed into the module, filled and available in the Main() yet it is not returned
- Don't forget to:
- rename the "starter code"
- add the validator file so you can get any information you need
- to add your Heading file and call it at the beginning of main
- a separate program to by module FillTheArray()


The following are my thoughts on how to deal with week's program. I'm doing this because this is a real-world kind of solution and once you understand a few things life will be better. First is why i gave you a program like this.I did it because by now you realize that with a large set ever changing of random numbers you can't really verify that your solution will actually work and that you're getting the correct answer. So, then the reasoning behind this is that when you work at some company and have to fix a problem, you can't use their whole database to test and validate your program. You will be using a small subset of the data. I want you to do the same. Cut the down list of 10,000 element array while creating your logic to 10 elements and assign exactly what you want to each location (like below). You will not only know what the answer to the modules should be but can change what's in the list so you can verify in many different scenarios. Cutting the array from 10,000 to 10 elements: bile static void main (Stringll argsi( tinal int SE 10, ENTRY 1320 int () itumarray new intuiEI: Assigning each element a specific value for testing: public statie void fillTheArray (int (1 iTemparrdy, int SIBE) to opied the shole presect and then thit the lo ITenparray[01 100; iTenparray(1)- 100; iTempArtay(21- 100: ITempAeray13 100: ITemparray(41- 100: iTenparray[5] = 100; iTemparrayf6)= 1320; iTempArray 7 100: irempArray18] 100 iremparray19] 1320: Second, i want to talk about the linear searches, For linearSearchOne you need to figure out if the number 1320 exist and if so, return a "true" from the function. The first question you need to ask your self is "what kind of structures I will need "? basically, if we want to look at an element of an array anc a variable to see if they contain the same information, we will need a decision structure. Then we will have to travel down the array of elements and check every one of them. or do we? Should we check every single element for the number 1320? Well, a linear search actually starts at the beginning of the array and does check every element in the array until it encounters the information it's looking for and then it stops. Now if we look at the loops to do this; we could use a for loop but how would we stop it when we find the number 1320? So that's not a great choice. What about the while loop? In it we still could use a "counter" or "index" to deal with the array subscript and we could also build in a Boolean to know when we found that number. We will have to bulld a compound condition so that it only runs when both are "true", Both means loop until I'm at the bottom of the list and stop when i find the
Step by Step Solution
3.32 Rating (146 Votes )
There are 3 Steps involved in it
Assignment 5 will be way different It will be more like what you will receive in a programming shop By that I mean that some things are built for you ... View full answer
Get step-by-step solutions from verified subject matter experts
