Respuesta :

Answer:

Program for the above question in python:

mass = float(input("Enter the mass in grams")) # It is used to take the mass as input.  

density = float(input("Enter the density grams per cm cube")) # It is used to take the input for the grams.

print("Volume ={:.2f}".format(mass/density)) #It is used to print the Volume.

Output:

  • If the user inputs as 2.98 and 3.2, then it will results as 0.92.

Explanation:

  • The above code is in python language, in which the first statement is used to take the inputs from the user for the mass and sore it into a mass variable.
  • Then the second statement also takes the input from the user and store it into a density variable.
  • Then the third statement of the code is used to print the volume up to two places using the above-defined formula.