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]
3 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]3 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
reagan's firm has not had to make large investments in computer or networking hardware or in personnel to maintain the hardware
GrogVix [38]

Since Reagan's firm has not had to make large investments in computer or networking hardware, the  key benefit of public cloud computing is option B:  reduced costs.

<h3>What equipment is employed for networking?</h3>

There are different kinds of equipment for networks. Hardware for networking is required for computers to communicate with one another. Bridges, hubs, as well as switches, and routers are all networking devices with slightly varied functions.

Therefore, In a public cloud, resources are made available by a third party provider through the internet and shared by businesses and individuals who want to use or buy them and low cost is a good advantage.

Learn more about cloud computing  from

brainly.com/question/19057393
#SPJ1

3 0
1 year ago
Suppose testcircle1 and circle1 in listing 9.1 are in two separate files named testcircle1.java and circle1.java, respectively.
zlopas [31]
What is "listing 9.1"?

Stop copying and pasting, or provide us with the resources to answer your question.
8 0
3 years ago
The layout gallery displays 10 slide layouts with a variety of placeholders to define text and content positioning and formattin
Papessa [141]
The above statement is FALSE.

The layout gallery displays 9 slide layouts NOT 10. 

These 9 layouts have various<span> placeholders to define text and content positioning and formatting.

</span>1 - Title slide
2 - Title and content
3 - Section Header
4 - Two content
5 - Comparison
6 - Title only
7 - Blank 
8 - Content with Caption
9 - Picture with Caption
8 0
3 years ago
You can use the Trim Video feature to specify a video file’s Start and End time in order to control which portion of the video f
mario62 [17]

Answer:

True

Explanation:

You can trim a video and actually set the start time and end time of a video on Powerpoint (a presentation software by microsoft) by following some simple steps.

select the video and click the playback tab, click the Trim video and a box will pop up, you can play the video and see how it is trimmed, and finally click OK.

5 0
3 years ago
How does Wireshark differ from NetWitness Investigator?
nikdorinn [45]

Answer is given below

Explanation:

  • Wireshark differ from NetWitness Investigator because
  • Windshark shows a detailed view of individual packets.
  • WireShark captures live traffic and displays the results at the packet level.
  • Netwitness shows a high-level view and can be compared to the new packet capture
  • NetWitiness Investigator provides a comprehensive overview of previously tracked traffic that can be used to view anomalies, compliance and attacks.
8 0
3 years ago
Other questions:
  • A cracked tone (reluctor) ring will often cause what type of problem
    13·1 answer
  • What are the only things that can be declared in an interface?
    11·1 answer
  • Which of these automotive repair areas helps the vehicle change speeds to operate efficiently under all conditions?
    5·1 answer
  • Which education level has the highest return on investment (ROI)? AHigh School Diploma BROI is equal for all of the above. CSeni
    6·1 answer
  • In the lecture, we saw that TCP waits until it has received three duplicate ACKs before performing a fast retransmit. Why do you
    10·1 answer
  • Melissa is working on her Cell class by adding new methods. However, in her most recent version, she is receiving errors in some
    14·1 answer
  • Why should you list more than one font if you are formatting some text using CSS?
    10·1 answer
  • Explain what the loop does and what the result of executing it will be.
    7·1 answer
  • NEED HELP! BRAINLIEST FOR WHOEVER ANSWERS CORRECTLY FIRST!!!
    14·1 answer
  • Consider the following recursive method. public static string recur(int val) { string dig = "" + (val % 3); if (val / 3 &gt; 0)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!