1. Design a header file named BonusUtility.h that contains a namespace named BonusUtility. The…

1. Design a header file named BonusUtility.h that contains a namespace named BonusUtility. The…
1.  Design a header file named BonusUtility.h that contains a namespace named BonusUtility. The BonusUtility namespace should contain definitions of the following functions: • A function template named swap that takes 2 references as parameters and swaps the values inside. i. HINT: This function template should work for any data type ii. HINT: DO NOT use the default swap function that is included in namespace std. • A function template named displayArray that takes an array of any type and the size of the array as parameters, then displays it separated by commas. 3.     (8 marks) Design a header file named RandomArray.h that contains a namespace named RandomArray. The RandomArray namespace should contain the definition of a class named RandomIntArray which contains the following members: – Data Members o A private data member to store a dynamic integer array o A private data member to store the size of the dynamic int array – Member Functions o A public non-inline member function named randomize that will take 3 parameters (a minimum, maximum, and seed) and fill the array with randomize numbers using rand(). ▪ The seed argument should have a default value of 104 ▪ use srand() to set the seed before using rand() o 2 overloaded functions: ▪ A public non-inline constructor function named generateArray that takes 0 arguments. • This function dynamically allocates an array with 10 items and a range of 0-100. ▪ A public non-inline constructor function named generateArray that takes 3 arguments. • Parameters: a size, a minimum, and a maximum. o The minimum argument should have a default value of 1000 o The maximum argument should have a default value of 2000 • Use the this pointer to set all data members • Using these parameters, generate a dynamic array and populate it with random numbers. o An overloaded copy assignment (operator=) member function: ▪ This function should: • Guard from self assignment • Deallocate any memory before copying data if the space cannot be used o A public non-inline member function that reverses the array ▪ Example: • Before Reversing: 5,9,2,8,4,6,64 • After Reversing: 64,6,4,8,2,9,5 4.     ▪ This should utilize your swap utility function o A public inline member function that will display the array. 5.      ▪ This should utilize your displayArray utility function o A public inline destructor function that deallocates memory for the dynamic array. 3.  Design the main program named LabTest1.cpp that will be used to test the class and function template above. The main program must do the following: – Prompt the user to enter the number of arrays they want to create – Use this number to create a dynamic array of RandomIntArray objects. – For each item in the dynamic array, ask the user to choose if they want a custom array or default array o If they choose default, generate the array with no arguments o If they choose size, ask the user to enter a size o If they choose range, ask the user to enter a size, minimum, and maximum – Display all of the randomly generated arrays to the user – Reverse all of the arrays – Display all of the reversed arrays to the user Please note that the error checking & handling for invalid inputs is required. The numbers generated should match the output below due to the seed that was specified. All input numbers and output arrays should be the exact same. A sample format of the output of the program could be as follows: ENTER THE NUMBER OF RANDOM INTEGER ARRAYS: 3 ARRAY 1: Default(d), Size (s), Range (r): d ARRAY 2: Default(d), Size (s), Range (r): s Size: 5 ARRAY 3: Default(d), Size (s), Range (r): r Size: 10 Minimum: 2 Maximum: 8 –BEFORE REVERSING– Array 1: 75, 28, 24, 8, 25, 95, 37, 36, 85, 69 Array 2: 377, 396, 291, 345, 477 Array 3: 2, 5, 5, 4, 5, 6, 7, 6, 5, 3 –AFTER REVERSING– Array 1: 69, 85, 36, 37, 95, 25, 8, 24, 28, 75 Array 2: 477, 345, 291, 396, 377 Array 3: 3, 5, 6, 7, 6, 5, 4, 5, 5, 2       May 05 2022 06:09 PM

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 (409) 205-8984

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 30% with the discount code GURUH