Question: LargeSmall.java File: // LargeSmall.java - This program calculates the largest and smallest of three integer values. public class LargeSmall { public static void main(String args[])

LargeSmall.java File:
// 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); } }
Understanding if-else Statements In this lab, you will complete a prewritten Java program that computes the largest and smallest of three integer values. The three values are -50, 53, and 78. 1. Open the file named LargeSmall java using Notepad or the text editor of your choice 2. Two variables named largest and smallest are declared for you. Use these variables to store the largest and smallest of the three integer values. You must decide what other variables you will need and initialize them if appropriate 3. 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. The output statement is written for you. 4. Compile the program. 5. Execute the program. Your output should be The largest value is 78 The smallest value is -50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
