Question: 1. in the code below, 2 variables (largest and smallest) are declared. use these variables to store the largest and smallest of three integer values.

1. in the code below, 2 variables (largest and smallest) are declared. use these variables to store the largest and smallest of three integer values. you must decide what other variables you will need and initialize them if appropriate.

2. write the rest of the program using assignment statements, if statements, or if else statements as appropriate. There are comments in the code that tell you where you should write your statements

3. compile and execute. Output should be:

The largest value is 78

The smallest value is -50

// LargeSmall.java - This program calculates the largest and smallest of three integer values.

public class LargeSmall { public static void main(String args[]) { // This is the work done in the housekeeping() method // Declare and initialize variables here. int largest; // Largest of the three values. int smallest; // Smallest of the three values. // This is the work done in the detailLoop() method //Write assignment, if, or if else statements here as appropriate. // This is the work done in the endOfJob() method // Output largest and smallest number. System.out.println("The largest value is " + largest); System.out.println("The smallest value is " + smallest); } }

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 Databases Questions!