(Practice) Write a C++
first second
16 18 23 24 52 77
54 91 11 16 19 59
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
C++ for Engineers and Scientists
- 02: Write C++ main program to perform the following: 1- Call a Function to read array A of two dimensional (3, 3) of type float. 2- Call a Function to display the content of two dimensional array A. 3- Call a Function to Find sum of secondary diagonal elements of the square matrix A and display the result.arrow_forward(Practice) a. Write a C++ program that adds the values of all elements in the val array used in Exercise 2 and displays the total. b. Modify the program written for Exercise 3a to display the total of each row separately.arrow_forwardWrite a C++ function that takes two integer arrays and adds each element of both arrays using pointers not by index and function must check the array size to ensure same number of elements.arrow_forward
- design and write one python code(all below in one code) You need to generate an array A that has numbers 1 to 30 using Numpy function, and output array A. Generate an array B that has numbers 5 to 34 using Numpy function, and output array B. Reshape arrav A to a matrix AM as 5 rows and 6 columns, and output matrix AM Reshape arrav B to a matrix BM as 6 rows and 5 columns, and output matrix BM. Plot array A, array B using Matplotlib functions. Computing matrix AM multiply matrix BM as matrix CM, output matrix CM. Save matrix CM to the disk file as data.txt. Using "for loop" to check each element in the matrix CM whether the element is larger than 100 or not, and output the result as True/False.arrow_forwardNote:This question is based on memory game development. With the aid of c++, utilize a 2 dimensional array of four columns and four rows to make use of a pack of 16 playing cards with eight matching pairs, and the makeup numbers of the card are 1-8. The main function should contain a call function. To randomly keep(store) the pair's in the array, utilize random number generatorsarrow_forward- in this exercise, please do not include and use string class. The function is using only array notation and manipulation.- string functions such as strlen is not allowed.- it should not have multiple return statements in the same function- there should be no global variable.- the function should not traverse the arrays more than once (e.g. looping through the array once only) A C++ PROGRAM named "changeCase" that takes an array of characters terminating by NULL character (C-string) and a boolean flag of toUpper. If the toUpper flag is true, it will go through the array and convert all lowercase characters to uppercase. Otherwise, it will convert all uppercase to lowercase. For example, if the array is {'H', 'e', 'l', 'l', 'o', '\0'} and the flag is true, then the array will become{'H', 'E', 'L', 'L', 'O', '\0'}. And if the flag is false, the array will become{'h', 'e', 'l', 'l', 'o', '\0'}arrow_forward
- Write C# statements to accomplish each of the following tasks: a. Display the value of the element of character array f with index 6. b. Initialize each of the five elements of one-dimensional integer array g to 8. c. Total the 100 elements of floating-point array c. d. Copy 11-element array a into the first portion of array b, which contains 34 elements. e. Determine and display the smallest and largest values contained in 99-element floating-point array w.arrow_forwardPLEASE DO YOUR OWN CODING NO COPYING Write an assembly program to compute the following expressions - Create a DWORD array named ‘z’ of size 3 using DUP operator. Leave the array ‘z’ uninitialized.You can denote the items in the array as [�!, �", �#], where �! is the first item, �" is the second item,�# is the third item- Update each array item using the following expressions. �! = � + 130�" = � + � − �!�# = � + � − 13 - Where x, y, r are 16-bit integer memory variables.- x = 10, y = 15, r = 4- Use mov, movzx, movsx, add, sub instructions only.- (hint: Do not alter the value of x, y and r during the computation. Transfer them to appropriate registers to docomputation)- At the end, open memory window to see the variable z stored in memory (little endian format).- If you code correctly, �! = 140 in decimal, �" = −115 in decimal, �# = 1 in decimal § Screenshot of the code and memory window showing the content of the variable z (little endianformat).arrow_forwardNote:This question is based on memory game developmentAlso kindly checkout and ensure code is working well before posting. With the aid of c++, utilize a 2 dimensional array of four columns and four rows to make use of a pack of 16 playing cards with eight matching pairs, and the makeup numbers of the card are 1-8. The main function should contain a call function. To randomly keep(store) the pair's in the array, utilize random number generatorsarrow_forward
- 2. Write a C++ program to input elements in two array and merge two array to third array.How to merge two array in C++ programming. Logic to merge two sorted array to thirdarray in C program.ExampleInputInput first array elements: 1, 4, 6, 9, 15Input second array elements: 2, 5, 8, 10OutputMerged array in ascending order = 1, 2, 4, 5, 6, 8, 9, 10, 15arrow_forwardProblem statement/example: Given an array = [2,3,6,10,11] and k = 9 (capacity), find the minium total of cost after adding new items to reach capacity. Values in array represent cost of item. The remaining items to choose from are [1,4,5,7,8,9,12,13....inf] output: Choosing 4 more packages to include with min values is [1,4,5,7], which returns 17 Write function getMinimumCost(arr,k):arrow_forwardQ2: Write a C++ program, using function, to compute the number of zeros in the array.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning