
C++
Problem #1:
- Create a blank 10x10 integer array using constants for the row and column
- Create a function printArray() that will print every row and column of the array
- Create a function notFound() that searches each element in the array and returns true if the passed number already exists in the array and false if it does not
- Create a function fillArray() that will fill the 2 dimensional array
with unique random numbers from 0 to 100 inclusive. No cells should have the same number. Use the notFound() function in this function.
- Print the entire array.
- Request a column number to print and use a sentinal loop to make sure the row number is valid. If not then request a column number again
- Create a function printIter() that prints only the passed column using iteration
- Create a function printRecur() that prints only the passed column using recursion
- Print the requested column using printIter() and printRecur()
Sample output:
The array is:
Row 0: 41, 85, 72, 38, 80, 69, 65, 68, 96,
Row 1: 22, 49, 67, 51, 61, 63, 87, 66, 24,
Row 2: 83, 71, 60, 64, 52, 90, 31, 23, 99,
Row 3: 94, 11, 25, 15, 13, 39, 97, 19, 76,
Row 4: 33, 18, 92, 35, 74, 95, 32, 37, 45,
Row 5: 57, 5, 86, 54, 75, 70, 29, 58, 46,
Row 6: 17, 3, 48, 77, 59, 62, 2, 78, 7,
Row 7: 84, 12, 47, 34, 21, 20, 9, 28, 100,
Row 8: 93, 4, 79, 81, 98, 91, 82, 1, 42,
Row 9: 88, 53, 56, 44, 73, 0, 30, 89, 55,
Enter a column number: 22
Enter a column number: -4
Enter a column number: 7
Iterative: 68, 66, 23, 19, 37, 58, 78, 28, 1,
Recursive: 68, 66, 23, 19, 37, 58, 78, 28, 1,

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

- Assume the following main module is in a program that includes the binarysearch function that was shown in a chapter. Why doesn't the pseudocode in the main module work?arrow_forwardThis program will display an array being passed to a function, show. The show function will display the elements of the given array. The main program controls the size and the inputs of an array. // function prototype void show(int [], int); int main(){ const int arraysize=5; int numbers[arraysize]={3,6,12,7,5}; show(numbers,arraysize); // (A) show(numbers,arraysize+1); return 0;} //function body void show(int nums[], int size){ for (int index=0;index<size; index++) cout<<nums[index]<<endl; } What is the output of this program? What is the output if modification (A) has been made?arrow_forwardPrompt: In Python language, write a function that applies the logistic sigmoid function to all elements of a NumPy array. Code: import numpy as np import math import matplotlib.pyplot as plt import pandas as pd def sigmoid(inputArray): modifiedArray = np.zeros(len(inputArray)) #YOUR CODE HERE: return(modifiedArray) def test(): inputs = np.arange(-100, 100, 0.5) outputs = sigmoid(inputs) plt.figure(1) plt.plot(inputs) plt.title('Input') plt.xlabel('Index') plt.ylabel('Value') plt.show() plt.figure(2) plt.plot(outputs,'Black') plt.title('Output') plt.xlabel('Index') plt.ylabel('Value') plt.show() test()arrow_forward
- Write a function that determines the average of the values in an array. In the main() function declare a floating point array with a length of 8 elements, and have the user enter the value of each element using a loop. The program should then call and pass the array to the function, then display the average.arrow_forwardJAVA PROGRAM: Monkey Business A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3 × 5 array, where each row represents a different monkey and each column represents a different day of the week. The program should first have the user input the data for each monkey, or use constant values rather than asking user for input. Then it should create a report that includes the following information: Display 3X5 array first. Average amount of food eaten per day by the whole family of The least amount of food eaten during the week by any one The greatest amount of food eaten during the week by any one Input Validation: Do not accept negative numbers for pounds of food eaten.arrow_forwardA single dimensional array might be treated as a 2-dimensional array.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





