Q1: Define a 2D array (Assuming the 2D Array to be a square matrix with odd...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Q1: Define a 2D array (Assuming the 2D Array to be a square matrix with odd dimension i.e. 3x3, 5x5, 7x7 etc.). The program contains the following • A function that fills the array with random numbers ranged between [ -20 to 20] which accepts a 2D array of integers and its size as arguments. • Afunction that prints the elements of the matrix. • A function that prints the sum of each diagonal of the array • A function that returns and print the maximum prime number if exists in the array. Q1: Define a 2D array (Assuming the 2D Array to be a square matrix with odd dimension i.e. 3x3, 5x5, 7x7 etc.). The program contains the following • A function that fills the array with random numbers ranged between [ -20 to 20] which accepts a 2D array of integers and its size as arguments. • Afunction that prints the elements of the matrix. • A function that prints the sum of each diagonal of the array • A function that returns and print the maximum prime number if exists in the array.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Repeat Prob. 2028 assuming the circuit board to be positioned horizontally with (a) chips facing up and (b) chips facing down. Repeat Prob. 2028 A 50-cm 50-cm circuit board that contains 121 square...
-
A square matrix is called a diagonal matrix if all the entries off the main diagonal are zero. If A and B are diagonal matrices, show that the following matrices are also diagonal. A - B
-
If A is a diagonal square matrix of order three with unequal diagonal elements a11, a22, a33, find the normalized eigenvectors of A.
-
Successful interviews are results of completing pre-interview tasks, such as Identifying the interviewee, doing research on the topic and interviewee, choosing a location or method for the interview,...
-
Give the IUPAC names of the following compounds. (a) CH3CH2C ¡CCOOH (b) CH3CH(NH2)CH(OH)COOH (c) (CH3)C==CHCOOH (d) (e) (f) CH COOH NO COOH No, !
-
The following table shows hypothetical demand schedules for sugar for three separate months. To help make the distinction between changes in demand and changes in quantity demanded, choose the...
-
Explain the significance of components in the context of object-oriented development.
-
Corporation XYZ has the following data on labor input and production of commodity Z for each of the eight production periods. 1. Use the data on labor input and total output to calculate the marginal...
-
Prove the agreement of Work in Process Inventory with job cost sheets pertaining to unfinished work. Post each to the T-account in the following order: (1) beginning balance, (2) direct materials,...
-
The proposed rates were not in the range the CEO expected given the pricing analysis. The CEO has asked the pricing actuary to verify the total projected loss cost excluding potential large storm...
-
lady with previous cesarean section presents in labour. Trial of normal vaginal delivery is contraindicated in: a) Breech presentation b) Fact of knowing that previous cesarean section was due to CPD...
-
A 72-kg woman is walking at \(1.5 \mathrm{~m} / \mathrm{s}\). An \(8-\mathrm{kg}\) dog is running at six times that speed in the same direction. At what speed and in what direction relative to the...
-
A \(15-\mathrm{kg}\) box is pushed at \(5 \mathrm{~m} / \mathrm{s}\) across a low-friction floor and is caught by a \(60-\mathrm{kg}\) man on low-friction skates, initially at rest. What is the...
-
If the 10-year Hong Kong government bond rate is 4.5 percent, the inflation premium is 2.3 percent, and the maturity-risk premium on the 10-year Hong Kong government bonds is 0.15 percent, assuming...
-
An 800-kg car moving at \(108 \mathrm{~km} / \mathrm{hr}\) hits and gets entangled with a large truck of inertia \(10,000 \mathrm{~kg}\) initially at rest. What is the kinetic energy of the wreckage?...
-
A \(2000-\mathrm{kg}\) car burns gasoline with \(25 \%\) efficiency. Accelerating from rest, how fast would this car go upon burning \(0.040 \mathrm{~L}\) of gasoline if \(1.0 \mathrm{~L}\) of...
-
Provide NFA and minimized DFA along with the DEA transition table for: (a) 1*(10)* (01)+
-
A police officer pulls you over and asks to search your vehicle because he suspects you have illegal drugs inside your car. Since he doesn't have reasonable suspicion to search your car, legally he...
-
A flat surface having the shape of an equilateral triangle, 20 cm on a side, is maintained at 400 K and exposed to air at 1 atm and 300 K. Calculate the heat lost from the top surface of the triangle.
-
A convection electric oven is one that employs a fan to force air across the food in addition to radiant heat from electric heating elements. Consider two oven temperature settings at 175oC and...
-
Saturated water vapor at 1 atm enters a horizontal 5-cm-diameter tube 1.5 m long. Estimate the condensation for a tube wall temperature of 98oC.
-
What is the relation between degrees Fahrenheit and degrees Rankine? And the relation between degrees Celsius and Kelvin?
-
State Newton's second law as you would apply it to a control mass.
-
Define a 1-pound force in terms of the acceleration it will give to a 1-pound mass. Give a similar definition for a newton in the SI system.
Study smarter with the SolutionInn App