Write the following mathematical expressions in Java dm msq
Solution
Mathematical Expression is:
For dm Mathematical Expression in java is:
dm= m*((Math.sqrt(1+(v/c))/Math.sqrt(1-(v/c)))-1);
For volume Mathematical Expression in java is:
volume = ( 4.0 / 3.0 ) * Math.PI * Math.pow( r, 3 );
For your more info i write down java code :-
package chegg;
public class MathematicalExpression {
public static void main(String[] args) {
/*here i declare all variable with some value*/
double v=49;
double c=52;
double m=2;
double r = 5;
double volume;
double dm;
/*mathematical expression for dm in java */
dm= m*((Math.sqrt(1+(v/c))/Math.sqrt(1-(v/c)))-1);
System.out.println(\"dm is :\" + dm);
/*mathematical expression for volume in java */
volume = ( 4.0 / 3.0 ) * Math.PI * Math.pow( r, 3 );
System.out.println(\"Volume is :\" + volume);
}
}
=================================
output for above code
dm is :9.604596790352806
Volume is :523.5987755982989
---------------------------------------------------------------------------------------------
If you have any query, please feel free to ask
Thanks a lot
