How many integer values are in the array

Assignment Help C/C++ Programming
Reference no: EM13338993

Write a function named "location_of_largest" that takes as its arguments the following:

(1) an array of integer values;
(2) an integer that tells how many integer values are in the array.

The function should return as its value the subscript of the cell containing the largest of the values in the array.

Thus, for example, if the array that"s passed to the function looks like this:
0 1 2 3 4
58 | 26 | 90 | 34 | 71

then the function should return the integer 2 as its value. If there is more than one cell containing the largest of the values in the array, then the function should return the smallest of the subscripts of the cells containing the largest values. For example, if the array that"s passed to the function is

0 1 2 3 4 5 6
58 | 26 | 91 | 34 | 70 | 91 | 88

then the largest value occurs in cells 2 and 5 , so the function should return the integer value 2 .

Reference no: EM13338993

Questions Cloud

How long does it take to fill the bucket completely : Elaine went to her outside faucet to fill a 0.0189-m3 bucket with water to wash her car. How long does it take to fill the bucket completely
Determine the density of the unknown liquid : A column of oil of height 70.0 cm supports a column of an unknown liquid. Determine the density of the unknown liquid
Would the atmospheric pressure at 5km above sea level : If the atmosphere warmed up by 5 degrees Celsius, would the atmospheric pressure at 5km above sea level increase or decrease, and by approximately how much
What is the volume of the secret cavity : A small sculpture made of brass (rbrass = 8470 kg/m^3) is believed to have a secret central cavity. What is the volume of the secret cavity
How many integer values are in the array : Write a function named "location_of_largest" that takes as its arguments the following.
What is the acceleration of gravity on this planet : You have just landed on a planet. You take out a block of mass 245g , release it from rest from a height of 14.01m, What is the acceleration of gravity on this planet
Determine the loss rate of particles from jeans escape : Determine the flux of particles escaping from the exobase of Earth's atmosphere using a number density at the exobase of 10^5 particles/cm^3 and a temperature of 700K.
Write an entire c++ program that reads a positive integer : Write an entire C++ program that reads a positive integer entered by an interactive user and then prints out all the positive divisors of that integer in a column and in decreasing order.
Estimate how far from site of impact resulting shock front : Suppose a 100m diameter stony (p= 3 g/cm^3) meteroid impacts the Earth with a speed of 20km/s. Assume all kinetic energy goes into the creation of an atmospheric blast wave.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program that generates 50 random numbers of type

Write a program that generates 50 random numbers of type integer ranges from 1 to 1000 and load all the numbers into a C++ vector. The program should then display the largest, the smallest, the sum, and the average values stored in the vector.

  Write a program to find the middle element in a linked list

1. Write a program to check if there is a loop in a linked list. Create a loop in a linked list and use your method 'isLoop' to identify that the loop exists. The method isLoop should return a Boolean type.2.

  Write c program that prompts for variable number of integers

Write a C program that prompts for a variable number of integers, adds them up, averages them, and prints out the average.

  Write me a function that finds the smallest item in an array

Write me a function that finds the smallest item in an ArrayBag (by reference) and returns true if the arrayBag is not empty and false otherwise.

  Calculates different formulas that converge to the number pi

Write a C program (Care should be taken not to use extensions of C + + language in your work ) that calculates different formulas that converge to the number  pi,  to compare the speed of convergence of these formulas. Each form will be calculated by..

  Which of the following is a true statement

Which of the following is a true statement?

  Write a function that accepts an int array

Element 0 of the argument arrayshould be copied to element 1 of the new array, element 1 of the argument array should be copied to element 2 of the new array, and so forth. The function shouldreturn a pointer to the new array.

  Develop a simple poker game

Develop a simple poker game

  Write an lc-3 machine language program

Write an LC-3 machine language program starting at location x3000 which divides the number in memory location x4000 by the number in memory location x4001 and stores the quotient at x5000 and the remainder at x5001.

  Design a simple atm service kiosk

Design a simple ATM service kiosk. This kiosk supports the following options for its menu: 1. Viewing your account balance2. Depositing cash3. Withdrawing cash

  Write a function that finds area and volume of a cube

write a function that finds area and volume of a cube when length is input and then write a program to test it. here is what i have so far.

  Least number of comparisons needed

What is the least number of comparisons needed to sort an array of 6 numbers, in the worst case, using any sorting algorithm that sorts with binary comparisons? Explain

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd