CSC C++ Program

Please Please Please Read the instructions and do everything listed there. if you no going to read the instructions and I received bad Credit I will do Bad Rating. 
Lab #11:
Write a program that will do the following:

In main, declare an array of size 20 and name it “randomArray.”  Use the function in step 2 to fill the array.  Use the function in step 3 to print the array.  

Create a function that generates 20 random integers with a range of 1 to 10 and places them into an array.  Re-cycle the functions from Lab 10 where appropriate.

Make this a function.
There will be two arguments in the parameter list of this function:  an array and the size of the array.

Within the function and the function prototype name the array:  intArray.
Within the function and the function prototype name the size of the array:  size.

The data type of the function will be void since the array will be sent back through the parameter list.
Bring in the function that generates and returns a random number that you created from the previous module.  Call that function from this within the loop that adds random numbers to the array.

Display the contents of the array.  Re-cycle the function that prints out the contents of an integer array from Lab 10.

Make this a function.
There will be two arguments in the parameter list of this function:  an array and the size of the array.

Within the function and the function prototype name the array:  intArray.
Within the function and the function prototype name the size of the array:  size.

The data type of the function will be void since the array will be sent back through the parameter list.

From main, generate one more random number (also from 1 to 10) from the random number function.  Do not put this in an array.  This is a stand alone variable that contains one random number.
Search though the array and count how many times the extra random number occurs.  It is possible that the extra random number may occur more than once or not at all.

Output:
•  Display the entire array.
•  Display the extra random number.
•  Depending upon the result of your search, display one of the following:
–  How many times the random number occurs.
–  That the random number did not occur at all.
Also include:

Use a sentinel driven outer While Loop to repeat the task

Ask the User if they wish to generate a new set of random numbers

Clear the previous list of numbers from the output screen before displaying the new set.

NOTE 1: Other than the prompt to repeat the task, there is no input from the User in this program.

NOTE 2: This program will have 3 functions:

The function that fills the array with random numbers.
The function that generates one random number at a time (re-use the one from Lab 10).
The function that prints out an array of integers (re-use the one from Lab 10).

======================= Please Read ======================

 
Searching Through Arrays
Now that we can store large amounts of data we are ready to learn was to process the data. One way is to search through the data we have stored.
To search for instances of a value in an Array, you use a looping structure – which begins with the starting position of the Array and loops through each consecutive cell. There are two types of searches.
If you are searching for a value where only one instance will occur in the array (no duplicates) then you search until the value is found or until you reach the end of the array. If more than one instance can occur in the array then you must search until you reach the end of the array. If you are not sure whether there will be only one instance of a value or not then you assume it could occur more than once and use the second method.
Searching for a single instance of a value in an Array
When searching for one instance, you use a sentinel driven While or Do Loop. When setting up the condition for the looping structure, you must stop when one of two things occur:
You must stop when the value is found
OR
You must stop when you reach the end of the Array
The pseudo-code would look like this:
initialize index to the beginning index value of your Array

initialize a flag (Boolean variable) to false to represent element not found

WHILE the flag is equal to false AND index is less than size of Array

      IF the element at Array (index) is equal to the element you are searching for THEN

             flag is assigned true (element found)

      ELSE

             increment index

      END IF

END WHILE

This will cycle through all of the elements stored in the Array and stop when the element is found OR when you are at the end of the Array – whichever comes first.
When the Loop ends the value of index will be one of two values. You can determine whether or not the element was found based upon the index value.

The Index Value will either contain the position of where the element was found OR it will be equal to the size of the array.

Remember, the condition to end the loop must be false – so the variable that counts will contain the size of the array if the element was not found.

When the Loop ends the value of flag will be either True or False.

If the value of flag is True then the element was found and index value will indicate where.
If the value of the flag is False then the element was not found and index will be equal to the size of the array.

Remember:

Value was NOT FOUND:

If the value of index is equal to the size of the array AND the flag is still false then the element was not found.

Value was FOUND:

If the value of index is NOT equal to the size of the array AND the Boolean flag is true then this means that the element was found and index contains the position number of where the element was found.

NOTE 1: This is only one way to search for a element contained within an Array. There are many other ways.
NOTE 2: This assumes there is only one instance of an element in the Array.
Searching for duplicate instances of a value in an Array
If you need to search for a value that can occur more than once in an array then you need to cycle through the ENTIRE Array (instead of stopping when the first instance is found) and count (using a different counter than the Loop index) how many times the element occurred. Within each cycle, a comparison is made between the value you are searching for and the contents of the cell. Each time there is a match you count it by incrementing a counter.
Initialize the counter to 0 (to start counting)

FOR (index is equal to beginning index value of Array, index is less than size of Array, increment index by 1)

      IF the element at Array (index) is equal to the element you are searching for THEN

             increment the counter (element found)

      END IF

END FOR
In this algorithm, when the looping structure ends the counter will either be zero or it will contain the number of instances the value occurred within the array. If the counter is zero then there were no instances of the value in the array.
 
Your Responsibilities in Module 11
Module Overview:
This Module continues with the topic of arrays. The focus is on how to process data stored within an array.  Searching for and sorting data within an array is discussed.
Module Learning Objectives:

Students will be able to search for data within an array.
Students will be able to use a simple sorting routine to sort data within an array.

Readings:
1.  Read all Mini-Lectures Module 11
2.  Text:

Chapter 9
Chapter 3.7 Review (Pages 143 -150)
Chapter 6.4  (Pages 321 – 323)

I will upload for you the textbook

Custom Paper Help
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.