Question: Problem 1 Given an array as follows long [ ] [ ] nums = { { 1 , 2 , 3 , 4 , 5

Problem 1
Given an array as follows
long [][] nums ={{1,2,3,4,5},{6,7,8,9},{10,11,12,13,14,15},{16,17,18,19,20},{21,22,23,24,25}};
Build the following methods:
1) calcTotal:The method should accept a two-dimensional array as an argument and return the total of all the values in the array.
2) calcAverage:The method should accept a two-dimensional array as an argument and return the average of all the values in the array.
3) calcRowAverage:The method should accept two parameters: 1) a two-dimensional array as an argument and 2) an integer that represents a row number for calculations. Return the average of all the values in that row in the array.
Problem 2
Two arrays are given:
String cars[]={"Honda Accord", "Chevrolet Suburban", "Dodge Charger", "Kia Optima", "Acura TLX"};
integer prices[]={17000,48000,24000,22500,17999};
Write a method that finds the cheapest car name, and returns back a String stating what the car name is and how much it costs. The method should take two arrays as two parameters (you do not need to make a two dimensional array out of these arrays).
Call this method from main(), receive the result, and show the result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!