【发布时间】:2016-03-24 03:17:21
【问题描述】:
我想知道是否有人可以帮助我找到一组变量的最大值并将它们分配给另一个变量。这是我的代码的 sn-p 可能有助于理解我在说什么。
// 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 + ".");
【问题讨论】: