Driver Code
public static void main ( String [ ] args ) { pair [ ] A = { new pair ( 0f , 0.1f ) , new pair ( 100f , 0.1f ) , new pair ( 200f , 0.2f ) , new pair ( 333f , 0.3f ) , new pair ( 400f , 0.3f ) } ; pair [ ] B = { new pair ( 100f , 0.1f ) , new pair ( 200f , 0.5f ) , new pair ( 700f , 0.4f ) } ; float avg_A = calculate_mean ( A ) ; float avg_B = calculate_mean ( B ) ; float std_A = calculate_std ( A ) ; float std_B = calculate_std ( B ) ; System . out . print ( " For ▁ Investment ▁ A " + "NEW_LINE"); System . out . print ( " Average : ▁ " + avg_A + "NEW_LINE"); System . out . print ( " Standard ▁ Deviation : ▁ " + std_A + "NEW_LINE"); System . out . print ( " Normalised ▁ Std : ▁ " + std_A / avg_A + "NEW_LINE"); System . out . print ( " For ▁ Investment ▁ B " + "NEW_LINE"); System . out . print ( " Average : ▁ " + avg_B + "NEW_LINE"); System . out . print ( " Standard ▁ Deviation : ▁ " + std_B + "NEW_LINE"); System . out . print ( " Normalised ▁ Std : ▁ " + std_B / avg_B + "NEW_LINE"); if ( ( std_B / avg_B ) < ( std_A / avg_A ) ) System . out . print ( "Investment B is less riskyNEW_LINE"); else System . out . print ( "Investment A is less riskyNEW_LINE"); } }