Each of the following functions contains errors. Locate as many as you can.
A) void showValues(int nums)
{
for (int count= 0; count< 8; count ++)
cout << nums[count];
}
B) void showValues( int nums[4] [])
{
for ( rows= O; rows< 4; rows++)
for (cols= O; cols< 5; cols ++)
cout << nums[rows] [cols ] ;
}
Trending nowThis is a popular solution!
Learn your wayIncludes step-by-step video
Chapter 8 Solutions
Starting Out with C++: Early Objects
Additional Engineering Textbook Solutions
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Starting Out with C++ from Control Structures to Objects (9th Edition)
- (Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate and return the average of values stored in an array named testvals. The array should be declared in main() and include the values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The variance() function should calculate and return the variance of the data. The variance is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calcavg() and variance() should be displayed by using cout statements in main().arrow_forwardDynamic Array Functions XLOOKUP What is one characteristic of the XLOOKUP) function that makes it so flexible? OPTIONS: It can only take dynamic arrays as input It can be used to lookup data both vertically and horizontally It always returns a matrix of data It takes only one input parameterarrow_forwardThe index type of an array can be any data type. True or false?arrow_forward
- Complete the following Codearrow_forward8arrow_forwardGame of Hunt in C++ language Create the 'Game of Hunt'. The computer ‘hides’ the treasure at a random location in a 10x10 matrix. The user guesses the location by entering a row and column values. The game ends when the user locates the treasure or the treasure value is less than or equal to zero. Guesses in the wrong location will provide clues such as a compass direction or number of squares horizontally or vertically to the treasure. Using the random number generator, display one of the following in the board where the player made their guess: U# Treasure is up ‘#’ on the vertical axis (where # represents an integer number). D# Treasure is down ‘#’ on the vertical axis (where # represents an integer number) || Treasure is in this row, not up or down from the guess location. -> Treasure is to the right. <- Treasure is to the left. -- Treasure is in the same column, not left or right. +$ Adds $50 to treasure and no $50 turn loss. -$ Subtracts…arrow_forward
- C++ Code with comments and output screenshot is must for an Upvote. Thank youarrow_forwardMatch each data operator with its function: OFFSET Returns the number of the elements in an array. TYPE Returns the size of a variables byte. SIZEOF Returns the memory adress of a variable. LENGTHOF Returns number of bytes used in an array.arrow_forwardArray Expander - Use Pointer Notation for the function and within the function. Use a main function and return the pointer from the ArrayExpander function to mainarrow_forward
- Programming Language: C++ Create a structure Student and ask the user how many students. Create an array which will save the number of students in the input. Ask for the data of the first and last student and display them.arrow_forwarddespite that the array parameter is preceded by the const qualifier, the array elements can be modified in the function body. Select one: True Falsearrow_forwardWrite a function to determine the resultant force vector R of the two forces F₁ and F2 applied to the bracket, where 0₁ and 0₂. Write R in terms of unit vector along the x and y axis. R must be a vector, for example R = [Rx, Ry]. The coordinate system is shown in the figure below: F₁ y 0₂ 0₁ 1 ►x F2arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,