1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
salantis [7]
3 years ago
11

Question 4(10pt): sum of the max value found in each row Write a function maxSum that takes two parameters; a 2D integer array w

ith 10 columns, and the number of rows. The function must return the sum of the maximum value from each row.
Computers and Technology
1 answer:
mario62 [17]3 years ago
5 0

Answer:

Following is the program in c++ language  

#include <iostream> // header file

using namespace std; // namespace

int maxSum(int ar[][10],int r) // function definition of  maxsum

{

  int s=0; // varaible declaration

  for(int k=0;k<r;k++)// iterating the loop

  {

      int maximum=ar[k][0]; //finding the maximum value

      for(int k2=0;k2<10;k2++)// iterating the loop

      {

          if(maximum<ar[k][k2]) // check the condition

          {

            maximum=ar[k][k2];   // storing the value in the maximum variable

          }

           }

       s=s+maximum;//adding maximum value to the sum

  }

  return s; // return the sum

}

int main() // main function

{

  int ar[][10]={{5,2,8,-8,9,9,8,-5,-1,-5},{4,1,8,0,10,7,6,1,8,-5}}; // initilaized array

  cout<<"sum of maximum value:";

  int t=maxSum(ar,2); // function calling

  cout<<t; // display the maximum value

}

Output:

sum of maximum value:19

Explanation:

Following are the description of Program  

  • The main method declared and initialized an array ar with the column value 10.
  • After that call the method maxsum .The control will move to the function definition of maxsum.
  • In the function header of maxisum there are two value i.e array "ar" and "r".
  • In this function definition, we adding the maximum value to the sum and return the variable "s".
  • In the main function, we print the value.
You might be interested in
You have important data on your hard drive that is not backed up and your Windows installation is so corrupted you know that you
Solnce55 [7]

Answer:

b.Make every attempt to recover the data

Explanation:

If you have important data on your hard drive that is not backed up and your Windows installation is so corrupted you know that you must refresh the entire installation you should  make every attempt to recover the data.

4 0
3 years ago
The prefix kilo stands for which one of the following values? A. 100 or 102 B. 1000 or 103 C. 1,000,000 or 106 D. 10,000 or 104
Jobisdone [24]
It means multiplying or dividing by 10, 100, 1000, etc
3 0
2 years ago
Read 2 more answers
Which should you consider when selecting a highlighting color?
hjlf

Answer:contrast

Explanation:

To make sure it’s easier to read

5 0
3 years ago
The photo-sharing site Instagram owed a good deal of its success to filters. What are filters?
creativ13 [48]

Adding a filter to a picture can change the whole effect of the picture. Say you wanted a more vintage theme for your picture, you could use a black and white theme to give it an old timey feel. Different filters can add effects to the picture, maybe the filter gives your picture a blueish cool toned tint, or maybe it adds more light to the filter.

6 0
3 years ago
Read 2 more answers
Most professional coding standards use _____ for class names. (Points : 2) underscores along with all upper case words
Natali [406]

Answer: Pascal case

Explanation:

 The most of the professional coder use the standard pascal case for initialize the name of the class in the programming language. The pascal is basically use for writing the class name and each word must begin with the capital letter.

The pascal casing is one of the popular case styling in the programming language which is also known as pascal programming language.

4 0
3 years ago
Other questions:
  • People in STEM careers are considered thinkers who reach conclusions through sound judgment and reasoning.
    11·1 answer
  • Initially, later, and finally are examples of what kind of words
    9·1 answer
  • network consisting of computers and other devices that are eithrr fully or partially connected to each other
    7·1 answer
  • Would these statements cause an error? Why or why not? int year = 2019; int yearNext = 2020; int &amp; ref = year; &amp; ref = y
    7·1 answer
  • James has a USB flash drive that he has used at work. The drive needs to be thrown away, but James wants to make sure that the d
    12·1 answer
  • What is the purpose of the website directory provided by the website host?
    5·1 answer
  • Which tool can be used to increase the space between a bullet point or a number and text?
    11·2 answers
  • How many 2/8 pound patties can she make from 7/8 of a pound of hamburger
    10·1 answer
  • True or False: F Layout is better for users who read left to right, but layout is better for users who read right to left.
    13·1 answer
  • How many residues separate amino acids that are stabilized by hydrogen bonds in α helices?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!