Question Index

Write a program to find the third mean if other two means are given. Two of arithmetic, geometric and harmonic means are given, then find the third mean.

Input (String, String) Output (String)
ArithmeticMean=10, GeometricMean=15 HarmonicMean=12.0
ArithmeticMean=50, HarmonicMean=75 GeometricMean=61.237243569579455
GeometricMean=150, HarmonicMean=85 ArithmeticMean=117.5
HarmonicMean=45, ArithmeticMean=65 GeometricMean=54.08326913195984

class CalculateThirdMean

{    public static void main(String s[])
        System.out.println("The result is : " + calculateThirdMean("GeometricMean=25", "ArithmeticMean=50"));


public static String calculateThirdMean(String firstMean, String secondMean) {
//Write code here to find the required mean, if the other two means are given



Topic: StringTokenizer In Java

Read this topic
Take test on this topic

Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App