/* The output will display answers up to 15 digits... The answers are to have a decimal accuracy of three places and they must be aligned. Also, I must not use the double to declare my variables. Please help a beginner programmer. */
[code]
public class JTwo
public static void main(String[] args)
{
//DECLARE VARIEBLES and ASSIGNNING VALUES!
int Radius, Height, Edge, Length, Width, SideA, SideB, SideC, A, B, C, D, E, F, VSphere, VCylinder, VCube, VBox, ExpressionOne, ExpressionTwo, TArea;
Radius = 5; //this is for the sphere.
Height = 4; //use this one for the volume of the cylinder.
Edge = 6; //Use this for the volume of the cube.
Length = 3; //box.
Width = 7; //box.
SideA = 6; //triangle side.
SideB = 6; //triangle side.
SideC = 1; //triangle side.
A = 8; //fractions
B = 3; //fractions
C = 4; //fractions
D = 2; //fractions
E = 1; //fractions
F = 9; //fractions
VSphere = (4.0)/(3.0)*(Math.PI)*Radius*Radius*Radius;
VCylinder = Math.PI*Radius*Radius*Height;
VCube = Edge*Edge*Edge;
VBox = Length*Width*Height;
ExpressionTwo = 1.0*(A + B)/(C + D);
ExpressionOne = 1.0*(A*B + C)/(D + E*F);
TArea = 0.25*Math.sqrt((SideA+SideB+SideC)*(SideB+SideC-SideA)*(SideA+SideC-SideB)*(SideB-SideC+SideA));
//THE VOLUME OF THE SPHERE!
System.out.printf("The volume of a sphere with given Radius = " + VSphere);
//The Volume of the cylinder
System.out.format("The volume of the cylinder with given Radius and Height = " VCylinder);
//THE VOLUME OF THE CUBE!
System.out.format("The volume of a cube with a given Edge = " + VCube);
//THE VOLUME OF THE BOX
System.out.format("The volume of the box with given Length, Width, Height = " VBox);
//ALGEBRAIC EXPRESSioNS
System.out.format("The expression (AB+C)/(D+EF) = " + ExpressionOne);
System.out.format("The expression (A+B)/(C+D) = " + ExpressionTwo);
//THE AREA OF THE TRIANGLE!
System.out.format("The area of the triangle with three given sides = " + TArea);
}
No, it's not all that matters. If you want help, go to the appropriate location. That means, in case you didn't understand, that you won't receive help here for your problem.
i came into this late... but it looks like computerquip bullied this guy until he closed his account, but before you get mad computerquip, i think you were in the right and he was just being stupid