Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Develop a C++ program that meets the following requirements: 1. Declare and defi

ID: 1931164 • Letter: D

Question

Develop a C++ program that meets the following requirements:

1. Declare and define a value returning function, named linearSearch which searches for a value through an integer array and returns the index position in which a value was found. If the value is not found, the return value must be -1. The function requires two parameters. Make sure that the array cannot be changed inside the function. Use an algorithm to determine the size of the array and assign such value to a variable named sizeOfArray.

2. Declare and define a void function, named bubbleSort which sorts an integer array in ascending order. The function requires one parameter. Use an algorithm to determine the size of the array and assign such value to a variable named sizeOfArray.

3. Declare and define a value returning function, named binarySearch which searches for a value through an integer array and returns the index position in which a value was found. If the value is not found, the return value must be -1. The function requires two parameters. Make sure that the array cannot be changed inside the function. Use an algorithm to determine the size of the array and assign such value to a variable named sizeOfArray.

4. Declare and define a void function, named printArray which prints the values of an integer array in a single line using the format { val1, val2,

Explanation / Answer

using System; using System.Collections.Generic; class Program { static void Main() { // // Create a new linked list object instance. // LinkedList linked = new LinkedList(); // // Use AddLast method to add elements at the end. // Use AddFirst method to add element at the start. // linked.AddLast("cat"); linked.AddLast("dog"); linked.AddLast("man"); linked.AddFirst("first"); // // Loop through the linked list with the foreach-loop. // foreach (var item in linked) { Console.WriteLine(item); } } } Output first cat dog man
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote