//calculate the mass
long massOfTheBlock = length * width * height * density
System.out.println("Length of the block, in cm is " + length);
System.out.println("Width of the block, in cm is " + width);
System.out.println("Height of the block, in cm is " + height);
System.out.println("The mass of the block is" + massOfTheBlock "grams")
AND
System.out.println("Height of the block, in cm is " + height);
System.out.println("");
// Calculate and print the block's mass.
System.out.println("The mass of the block is "
+ (length * width * height * AL_DENSITY) + " grams");

New Topic/Question
Reply




MultiQuote







|