Reference no: EM131310293
COMPUTER APPLICATIONS DIVISION
Assignment: C++ PROGRAMMING
STL Vector
For this assignment, you will be starting with an example program that demonstrates the use of a STL vector. In addition to this, you may need to look up how to generate random numbers.
Your end project will enter 100 random numbers (range 0-9) into the vector. Then, ask for a number to search for, and count how many there are in your group. When you complete the assignment, I want you to answer a couple questions about random numbers. Here are the details.
Start with the STL_Vector example. Use the rand function to generate random numbers between 0 and 9. If you need help generating random numbers see:
https://www.cplusplus.com/reference/cstdlib/rand/. Set up a for loop that puts 100 of these random number into a STL Vector. Change the printVector function in the example to print out all of the contents of your vector. Now you can see the contents of the vector which is the 100 random numbers you generated.
Write a second function called countElements. The definition will be:
int countElements( const std::vector<unsigned int>& MyVector, unsigned int SearchValue );
You will pass into countElements your vector (by reference), and the number you are looking for.
Your function will use a for loop with an iterator (like the one used in printVector) to compare each Vector element to the SearchValue. Count up the number of matches and return the total count.
You have an example executable program to mimic.
Questions to Answer in your ReadMe.txt file.
Are your numbers truly random? Run your program a number of times. Do you get the same numbers each time you run it? If not, can you make them random?
Put your findings in your ReadMe.txt file.
Ummarize your course project and share any difficulties
: Walmart is one of the largest companies in America; it has solidified its position as the biggest retailer in America and the world over with several branches all around the globe. Walmart prides itself in affordable products for everyday American..
|
How planning and operation flow differs for mto and mts firm
: Discuss how the planning/coordination and operation flow differs for MTO and MTS firms.- Compare and contrast the role of planning/coordination and operations in improving firm competitiveness.
|
Principles in a business environment
: You are to complete a minimum 500-word essay in which you describe resource pooling architecture and how you would apply these principles in a business environment.
|
Generate a second message that produces the same hash value
: A network consists of n hosts. Assuming that cryptographic keys are distributed on a per-hostpair basis, compute how many different keys are required.
|
Write a second function called countelements
: C0227 C++ PROGRAMMING- Write a second function called countElements. The definition will be: int countElements( const std::vector & MyVector, unsigned int SearchValue );
|
Discuss the driver and role of the inventory deployment
: Discuss why it is important to coordinate the arrival of procurement shipments with the dispatching of customer shipments.
|
Write a program that creates three identical arrays
: Write program that create three identical array, list1, list2, and list3 of 5000 elements. Write a function, removeAt, that takes three parameters: an array of integers, the number of elements in the array, and an integer (say, index).
|
Role of crm system in enhancing the firms competitiveness
: Discuss the rationale and risks associated with using a common forecast to drive the firms planning/coordination flow.
|
Principles in a business environment
: You are to complete a minimum 500-word essay in which you describe resource pooling architecture and how you would apply these principles in a business environment.
|