import java.util.*; import javax.swing.*; public class Lab04Exercise2 { public static void main(String[] args) { //3 random integers, 1 .. 99 Random generator = new Random(); int a = generator.nextInt(99) + 1; int b = generator.nextInt(99) + 1; int c = generator.nextInt(99) + 1; System.out.println( a + " " + b + " " + c ); //**** Calculate the largest integer value into max **** //ALGORITHM //Step 1: assign max from a //Step 2: re-assign max from b if b is larger than max //Step 3: re-assign max from c if c is larger than max int max = 0; //**** Calculate the smallest integer value into min **** //ALGORITHM: Similar to the algorithm to find max int min = 0; //**** Calculate the median integer value into med **** //ALGORITHM: //Step 1: Sum the 3 integers //Step 2: Subtract the min and max values int med = 0; //Display the numbers in ascending order System.out.println( min + " " + med + " " + max ); } }