Explanation of Solution
Compute maximum and minimum of an array:
Consider the below java code for a loop that simultaneously computes both the maximum and minimum of an array:
//imagine the first element as minimum number
int min = my_values[0];
//imagine the first element as maximum number
int max = my_values[0];
//loop to compute both maximum and minimum values
for (int i = 1; i < my_values.length; i++)
{
//checks whether my_values[i] is greater than max or not
if (my_values[i] > max)
{
//store the maximum value into max
max = my_values[i];
}
//checks whether my_values is less than min or not
if (my_values[i] < min)
{
//store the minimum value into a min
min = my_values[i];
}
}
//print the maximum number in the given array
System.out.println("maximum Number in a given array is : " + max);
//print the minimum number in the given array
System...

Want to see the full answer?
Check out a sample textbook solution
Chapter 6 Solutions
BIG JAVA: LATE OBJECTS
- PHP is the server-side scripting language. MySQL is used with PHP to store all the data. EXPLAIN in details how to install and run the PHP/MySQL on your computer. List the issues and challenges I may encounter while making this set-up? why I asked: I currently have issues logging into http://localhost/phpmyadmin/ and I tried using the command prompt in administrator to reset the password but I got the error LOCALHOST PORT not found.arrow_forwardHTML defines content, CSS defines layout, and JavaScript adds logic to the website on the client side. EXPLAIN IN DETAIL USING an example.arrow_forwardusing r languangearrow_forward
- List down the strenghts and weaknesses of your team project for Capsim Simulation? Explan.arrow_forwardCapsim Team PowerPoint Presentations - Slide Title: Key LearningsWhat were the key learnings that you discovered as a team through your Capsim simulation?arrow_forwardWrite the SQL code that permits to implement the tables: Student and Transcript. NB: Add the constraints on the attributes – keys and other.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





