1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Novay_Z [31]
2 years ago
15

he specific gravity of gold is 19.3. Write a MATLAB program that will ask the user to input the mass of a cube of solid gold in

units of kilograms and display the length of a single side of the cube in units of inches. The output should display a sentence like the following one, with the length formatted to two decimal places.

Computers and Technology
1 answer:
Rama09 [41]2 years ago
4 0

Explanation:

Specific gravity of gold = G = 19.3

We know that the specific gravity of gold is given by

G = ρg/ρw

Where ρg is the density of gold and ρw is density of water which is 1000 kg/m³

Now we can find out the density of gold

ρg = G*ρw

ρg = 19.3*1000

ρg = 19300 kg/m³

We also know that density and mass are related as

density = mass/volume

ρg = m/V

where volume of cube is given by

V = s³

Where s is the length of each side

ρg = m/s³

s³ = m/ρg

s = ∛(m/ρg) meters

To convert from meters to inches multiply by 39.37

s = ∛(m/ρg)*39.37 inches

Finally we get the relation of mass and length of side of a gold cube.

Matlab Code:

density = 19300;

% get input from the user that is mass of gold in kg

mass= input('Please input mass of gold in kg\n');

% check if the user has entered valid mass if it is less than or equal to zero then display error

if (mass<=0)

fprintf('Error: Wrong input! please try again');

else

% If the mass is valid then calculate the length of side of the cube

s = (mass/density);

% nthroot() is used to calculate the cube root

s = nthroot(s,3);

% to convert from meters to inches

s = s*39.37;

% finally display the length with 2 decimal points accuracy

fprintf('The length of side of the gold cube is: %.2f inches\n', s);

end

Output:

Please input mass of gold in kg

-2

Error: Wrong input! please try again

Please input mass of gold in kg

0.4

The length of side of the gold cube is: 1.08 inches

You might be interested in
Climatologist use weather balloons, stethoscopes, and satellites true or false
Nonamiya [84]

Answer:

False.

Explanation:

A stethoscope is a medical instrument which is used for listening to the work of the heart and lungs.  It consists of a microphone that rests on the patient's chest, and rubber tubes that bring the sound to the earphones. An ordinary stethoscope does not have any moving or electrical parts, as it only mechanically conducts sound from the patient's chest to the doctor's ear.   One of the simplest examinations that doctors perform today is listening to the lungs and heart with a stethoscope. With the help of this instrument, noises are heard during the work of the lungs and heart.

8 0
2 years ago
Why is the radial gradient type a good choice for the grapes?
Grace [21]
<span>when you use the radial gradient fill it gives it a look like a shine on them. </span>
3 0
3 years ago
Read 2 more answers
Differentiate Between<br>Master file and transaction file<br>​
Ray Of Light [21]

Answer: money

Explanation: money is life and the air is fat is full of fart

5 0
2 years ago
Read 2 more answers
I have been trying to use brainly recently but i cant because everytime i watch an ad to get an answer, its an interactive ad, s
Troyanec [42]

Answer:

remove ads

Explanation:

by buying a no ad pack

5 0
2 years ago
What is percent encoding and why is it used?
ehidna [41]

Answer:

 Percent encoding is the mechanism for encoding the information in the URI  (Uniform resource identifier) that basically transmitted the special variable or characters in the URI to the cloud platform.

It is also used in various application for transferring the data by using the HTTP requests.

Percent encoding is also known as uniform resource locator (URL) encoding. The percent encoding basically used to convert the non ASCII characters into URL format which is basically understandable to the all the web server and browsers. In percent encoding the percent sign is known as escape character.

7 0
2 years ago
Other questions:
  • What should the timing of transition slides be per minute?
    9·2 answers
  • As you move the click and type pointer around the document, the icon changes to represent ____________________ that will be appl
    10·2 answers
  • Write a method swaparrayends() that swaps the first and last elements of its array parameter. ex: sortarray = {10, 20, 30, 40} b
    15·1 answer
  • HI GIVING BRAINLIEST Tyra used the software development life cycle to create a new game. She released it to her friends in order
    14·2 answers
  • Which term describes the distance from one point on a wave to the same point on the next wave?
    13·2 answers
  • What is one major difference between the roles of film directors and theater directors? A. A theater director is involved in sel
    14·1 answer
  • Is a defense of a political position an argument
    7·1 answer
  • Explain
    6·1 answer
  • If you try to add a new item to a full stack the resulting condition is called a(n)?
    13·1 answer
  • Which instruction is used to convert an integer value to float and push it onto the fpu stack?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!