小编nyb*_*ler的帖子

如何找到变量集的最大值

我想知道是否有人可以帮我找到一组变量的最大值并将它们分配给另一个变量.这是我的代码片段,可能有助于理解我在说什么.

// 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: …
Run Code Online (Sandbox Code Playgroud)

java variables max

13
推荐指数
1
解决办法
8万
查看次数

标签 统计

java ×1

max ×1

variables ×1