. Given the following parallel arrays:
int[] arrProdNumber = new int[] { 100, 115, 125, 142, 163, 199, 205, 388 };
string[] arrProdDesc = new string[] { "Kitten", "Cat", "Bird", "Chicken", "Dog", "Puppy", "Aardvark", "Zebra" };
Write a C#
the product number array for that number. If it is found, then your program should report the product number they
entered and the corresponding product description. If the product number they enter is not in the first array, then your
program should indicate that item number was not found. Here’s a sample run:
//first run
Enter product number: 115
Item #115's product description is Cat
//second run
Enter product number: 1963
Item #1963 does not exist in your inventory
Some Random Number Generation Hints
Random rndNumber = new Random();
Console.WriteLine(rndNumber.Next()); //random integer
Console.WriteLine(rndNumber.Next(101)); //random integer between 0 and 100
Console.WriteLine(rndNumber.Next(10, 43)); //random integer between 10 and 42
Console.WriteLine(rndNumber.NextDouble()); //random double greater than 0, but less than 1
Console.WriteLine(rndNumber.NextDouble()*10); //random double between 0 and 10
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- 1. Implement a class IntArr using dynamic memory. a. data members: capacity: maximum number of elements in the array size: current number of elements in the array array: a pointer to a dynamic array of integers b. constructors: default constructor: capacity and size are 0, array pointer is nullptr user constructor: create a dynamic array of the specified size c. overloaded operators: subscript operator: return an element or exits if illegal index d. "the big three": copy constructor: construct an IntArr object using deep copy assignment overload operator: deep copy from one object to another destructor: destroys an object without creating a memory leak e. grow function: "grow" the array to twice its capacity f. push_back function: add a new integer to the end of the array g. pop_back function: remove the last element in the array h. getSize function: return the current size of the array (not capacity) i. Use the provided main function (next page) and output example Notes a. grow…arrow_forward23. In the C++ language write a program to find the product of all the elements present in the array of integers given below. int numArr[5] = {16,4, 8, 7, 12};arrow_forwardIn C++ struct myGrades { string class; char grade; }; Declare myGrades as an array that can hold 5 sets of data and then set a class string in each position as follows: “Math” “Computers” “Science” “English” “History” and give each class a letter gradearrow_forward
- c++ programming Initialize a string array named person with your first, middle andlast name as separate elements. Print the middle name from the array. Iterate to print all values of the array. Output Example WilliamJohn William Henryarrow_forwardWhat’s the difference between an array and Vector?arrow_forwardC++arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education