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
When compared to traditional desktop customers, why are mobile phone users much more likely to book a room or airline reservatio
Gnesinka [82]
With mobile phone you can access data/internet wherever reception/coverage whereas desktop users cannot
4 0
3 years ago
Some cases have ____, also called spacers, which are round plastic or metal pegs that separate the motherboard from the case, so
lara [203]

Answer:

The answer is "standoffs ".

Explanation:

It is rolling metal or plastic pins, which is used to divide the computer frame from the chipset are stiffer springs or pauses. It unplugs the desks, and unscrew the fasteners, which keep the board on to the cases to remove the piece.

  • It is a fixed size hooked divider used only to elevate each element above others and in such an ensemble.  
  • It is generally round or hex, typically made of copper, brass or nylon.
6 0
3 years ago
Which example illustrates the idea of "collecting data"?
ivolga24 [154]

Answer:

A. mining all product reviews from an online store for further processing.

Explanation:

5 0
2 years ago
Read 2 more answers
What is a disruptive technology? Give an example of an aspect of society that has been impacted by technological change.
Ray Of Light [21]

Answer:

A disruptive technology sweeps away the systems or habits it replaces because it has attributes that are recognizably superior. Recent disruptive technology examples include e-commerce, online news sites, ride-sharing apps, and GPS systems.

4 0
2 years ago
A palindrome is a string that reads the same from left to right and from right to left. Design an algorithm to find the minimum
stepladder [879]

Answer:

Explanation:

The following code is written in Python. It is a recursive function that tests the first and last character of the word and keeps checking to see if each change would create the palindrome. Finally, printing out the minimum number needed to create the palindrome.

import sys

def numOfSwitches(word, start, end):

   if (start > end):

       return sys.maxsize

   if (start == end):

       return 0

   if (start == end - 1):

       if (word[start] == word[end]):

           return 0

       else:

           return 1

   if (word[start] == word[end]):

       return numOfSwitches(word, start + 1, end - 1)

   else:

       return (min(numOfSwitches(word, start, end - 1),

                   numOfSwitches(word, start + 1, end)) + 1)

word = input("Enter a Word: ")

start = 0

end = len(word)-1

print("Number of switches required for palindrome: " + str(numOfSwitches(word, start, end)))

3 0
2 years ago
Other questions:
  • Mr. Green maintains a spreadsheet containing data on all of his employees, including name, job profile, monthly salary, and home
    15·1 answer
  • A cloud file system (CFS) allows users or applications to directly manipulate files that reside on the cloud.
    6·1 answer
  • How to understand amortized analysis potential?
    12·1 answer
  • Microsoft Windows is the least used operating system. TRUE or FALSE.
    13·1 answer
  • Which of these would NOT be a valid Internet Control Message Protocol (ICMP) error message:
    6·1 answer
  • _____ include the people, procedures, hardware, software, data, and knowledge needed to develop computer systems and machines th
    11·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    13·1 answer
  • How ssd is better than normal sata and pata HDD​
    11·1 answer
  • Do you remember your first 3D movie experience? What was the movie, what was the experience like, and why was it memorable? (If
    7·1 answer
  • 3.<br>Give two reasons why everyone should study technology<br>​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!