Cómo encontrar el valor máximo del conjunto de variables
Me preguntaba si alguien podría ayudarme a encontrar el valor máximo de un conjunto de variables y asignarlas a otra variable. Aquí hay un fragmento de mi código que puede ayudar a comprender de qué estoy hablando.
// Ask for quarter values.
System.out.println("What is the value of the first quarter?");
firstQuarter = input.nextDouble();
System.out.println("What is the value of the second quarter?");
secondQuarter = input.nextDouble();
System.out.println("What is the value of the third quarter?");
thirdQuarter = input.nextDouble();
System.out.println("What is the value of the fourth quarter?");
fourthQuarter = input.nextDouble();
//Tell client the maximum value/price of the stock during the year.
//maxStock = This is where I need help
System.out.println("The maximum price of a stock share in the year is: $" + maxStock + ".");