Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction Raphael is trying to find the mass of certain objects, but he doesn't have access to a scale.Oh no!Raphael, however, remembers his chemistry teacher

Introduction

Raphael is trying to find the mass of certain objects, but he doesn't have access to a scale.Oh no!Raphael, however, remembers his chemistry teacher once explaining how you can find the mass of an object using density and volume.Raphael has the density and volume of each of his objects, yet he can't seem to remember how to relate the two to find mass.

Using the formula: Density = Mass / Volume

Write a program to find the mass of each of Raphael's objects.

Program Input

The first line of the fileProb06.in.txtwill contain a positive integer T denoting the number of test cases that follow.Each test case will have the following input:

The object's density followed by the object's volume separated by a single space

Example Input:

4

5.00 3.75

6.00 2.00

18.00 3.01

57.30 9.02

Program Output

Your program should print out the mass of each object rounded to two decimal places. Each number should have two decimal places even if it consists of trailing zeros.

Example Output:

18.75

12.00

54.18

516.85

Sample Input

4 5.00 3.75 6.00 2.00 18.00 3.01 57.30 9.02 

Sample Output

18.75 12.00 54.18 516.85 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions

Question

=+What accounts for this?

Answered: 1 week ago