I will only take 3 values from the user, so there are only 3 possible answers. You can also assume that the user won't enter 0 three times and that it wouldn't matter if they entered the same value three times. I can create my own stuff for those scenarios (and I already have).
import java.util.Scanner;
import java.io.*;
import java.util.*;
public class Triangles
{
public static void main (String[]args) throws IOException
{
String a = "You have an";
String b = "triangle";
double l;
Scanner lengthinput = new Scanner(System.in);
double h;
Scanner heightinput = new Scanner(System.in);
double w;
Scanner widthinput = new Scanner(System.in);
System.out.println("Enter the length.");
l = lengthinput.nextDouble();
System.out.println("Enter the height.");
h = heightinput.nextDouble();
System.out.println("Enter the width.");
w = widthinput.nextDouble();
double max = l;
if (w > max) max = w;
if (h > max) {max = h;
The reason I'm struggling is because of the following:
I know the max, now I should just replicate the max code to create a minimum (since that's all I've learned just yet (intro CS class)). However, how would I know how to exclude the minimum value from being the one that I randomly select? Then the same for the medium value.