Reference no: EM13165511
Write a program that creates a two-dimensional array initialized with test data. Use any data type you wish. The program should have the following functions:
getTotal. This function should accept a two-dimensional array as its argument and return the total of all the values in the array.
- getAverage. This function should accept a two-dimensional array as its argument and return the average of all the values in the array.
- getRowTotal. This function should accept a two-dimensional array as its argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the total of the values in the specified row.
- getColumTotal. This function should accept a two-dimensional array as its argument and an integer as its second argument. The second argument should be the subscript of a column in the array. The function should return the total of the values in the specified column.
- getHighestInRow. This function should accept a two-dimensional array as its argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the highest value in the specified row of array.
- getLowestInRow. This function should accept a two-dimensional array as its argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the lowest value in the specified row of array.
Arrays & more loops practice
: Write a program ArraysAndLoops and implement the following in the main method:
|
State what kind of compound is dihydroxypentane
: What kind of compound is 2,3-dihydroxypentane? From what precursor do you synthesize the kind of compound that 2,3-dihydroxypentane is?
|
The main program should create an ifstream
: For decryption, the main program should create an ifstream for the file to be decrypted. It should use the getline method of the ifstream to read lines from the file, call the encryption / decryption function with the line to be decrypted, and dis..
|
People must be in a group in order to guarantee
: How many people must be in a group in order to guarantee that two people in the group have the same birthday (don't forget leap year)?
|
This function should accept a two-dimensional
: getLowestInRow. This function should accept a two-dimensional array as its argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the lowest value in the specif..
|
Considered to be an improved version
: Part (c) is considered to be an improved version of Part (b). You may use an array (2-dimessional) to store some values that has been computed during the run so that when making recursive calls the program does not compute certain values over and ..
|
What mass of this substance must evaporate
: What mass of this substance must evaporate in order to freeze 112 of water initially at 18? (The heat of fusion of water is 334 the specific heat of water is 4.18 .
|
Flaw in your design and outline
: After completing Part a, discuss the flaw in your design and outline some code that will cause it to break (your code should compile fine and will also execute without an error but will violate how a rectangle or square should behave).
|
Calculate the mole percent composition of the mixture
: Calculate the weight percent composition of the mixture, using the same assumptions as in part A.
|