C++ Code:
#include<iostream>
using namespace std;
// function named findTarget that takes three parameters:
// numbers, an array of integers
// size, an integer representing the size of array
// target, a number
bool findTarget(int numbers[], int size, int target)
{
int i;
for( i = 0 ; i < size ; i++ )
// if the element is found
if( numbers[i] == target )
return true;
// if the element is not found
return false;
}
// myArray, an array of doubles
// size, an integer representing the size of array
// The function returns the smallest value in the array
double minValue(double myArray[], int size)
{
int i;
double min = myArray[0];
for( i = 1 ; i < size ; i++ )
if( myArray[i] < min )
min = myArray[i];
return min;
}
void fillAndFind(int numArray[], int length)
{
cout<<"Enter "<<length<<" number : ";
int i;
for( i = 0 ; i < length ; i++ )
cin>>numArray[i];
}
int main()
{
int numbers[] = { 1, 2, 3, 4, 5, 6, 7 };
double myArray[] = { 1.2, 5.6, 2.46, 3.5, 7.8 };
int numArray[6];
if( findTarget( numbers, 7, 5 ) )
cout<<"5 is present in array.";
else
cout<<"5 is not present in array.";
double min = minValue(myArray, 5);
cout<<"\nMin value : "<<min<<endl<<endl;
fillAndFind(numArray, 6);
int i;
cout<<"numArray : ";
for( i = 0 ; i < 6 ; i++)
cout<<numArray[i]<<" ";
return 0;
}
Output:

In c++ 1. Write a function named findTarget that takes three parameters - numbers: an array...
1. Write a function named findTarget that takes three parameters: numbers, an array of integers - size, an integer representing the size of array target, a number The function returns true if the target is inside array and false otherwise 2. Write a function minValue that takes two parameters: myArray, an array of doubles size, an integer representing the size of array The function returns the smallest value in the array 3. Write a function fillAndFind that takes two parameters:...
Write a function named findTarget that takes three parameters: - numbers, an array of integers - size, an integer representing the size of array - target, a number The function returns true if the target is inside array and false otherwise
Write a function named numPerfect that takes as parameters: an array of integer scores between zero and 100 (inclusive) the size of the array and returns the number of perfect scores in the array. Also write a main function that creates and initializes an array of ints (in the appropriate range), calls the function with that array, and prints out the return value.
Write a C++ function, smallestIndex, that takes as parameters an
int array and its size and returns the index of the first
occurrence of the smallest element in the array. To test your
function, write a main that prompts a user for a list of 15
integers and outputs the index and value of the first occurrence of
the smallest value.
The program should print out
Enter 15 integers:
The position of the first occurrence of the smallest element in...
Write a C++ function, lastLargestIndex that takes as parameters an int array and its size and returns the index of the "last occurrence" of the largest element in the array. Include another function to print the array. Also, write a program to test your function. [HINTS) Create an array of size 15 in the main function and initialize it with the values shown in the below sample output. Pass the array and its size to function lastLargestindex; function lastLargestindex returns...
(C++) Write a function, remove, that takes three parameters: an array of integers, the number of elements in the array, and an integer (say, removeItem). The function should find and delete the first occurrence of removeItem in the array. (Note that after deleting the element, the number of elements in the array is reduced by 1.) Assume that the array is unsorted. Also, write a program to test the function. Your program should prompt the user to enter 10 digits...
Program must be wriiten in c++ Write a function, removeAt, that takes three parameters: an array of integers, the number of elements in the array, and an integer (say, index). The function should delete the array element indicated by index. If index is out of range or the array is empty, output an appropriate message. (Note that after deleting the element, the number of elements in the array is reduced by 1.) Assume that the array is unsorted.
Write a C function named isSymmetric, the prototype of which is given below, that returns 1 if the elements of an array of integers named myArray of size n are symmetric around the middle. If the array elements are not symmetric, the function should return 0. Both the array and its size are specified as parameters.
Write a C++ function binsearch that carries out the binary search algorithm on a sorted array of integers. Your function takes as parameters an array of integers (sorted in increasing order), the size of the array, and a target integer to search for. The function returns the index of the target in the array, and returns -1 if the target is not in the array. The file main1.txt on the webpage contains code that generates a specific array of integers...
for this assignment you will be creating a series of functions for manipulating an array of data. The data will consist of randomly generated doubles. You should make the following functions: generate() - This function fills an array with random doubles in a specified range. This function takes four inputs: an array of doubles, an integer representing the size of the array, and two doubles representing the lower an upper bounds of the range random values. For example, the function...