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
In many supermarkets customers can pay for their shopping using credit cards. (a) Name two items of information stored on the ma
slamgirl [31]

Answer:

Explanation:

Two items on the magnetic strip are, Credit Card info and Balance

Two ways supermarket may check are the PIN pad you are using to pay or their reciept system.

7 0
3 years ago
Help me. thank you very much
Scilla [17]

Answer:

3425236235623523334252362356235233342523623562352333425236235623523334252362356235233362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233  5623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363425236235623523334252362356235233342523623562352332

Explanation:

342523623562352333425236235623523334252362356235233342523 6235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425 5236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233

4 0
2 years ago
Which element of presentation software can you use to add callouts and banners?
Harrizon [31]
<span><span>1.)From the Insert tab, select the Shapes command. A drop-down menu will appear.
</span><span>2.)Select the desired shape
3.)</span></span>Click and drag<span> the slide to create the shape. You may need to move or resize the shape so it points to the desired part of the image.
4.)</span><span>f you want your callout to contain text, start typing while the shape is selected.
5.)</span><span>From the </span>Format<span> tab, you can use the options in the </span>Shape Styles<span> group to customize the appearance of the shape. You can also adjust the font from the Home tab</span>
7 0
3 years ago
Read 2 more answers
Each wireless network has its own name to identify it, known as service set identity. true false
Dominik [7]
True. The acronym for service set identity is SSID, which you've likely saw before. And like you say, it's simply the unique name given to a wireless network so that we are able to identify what network we are connecting to.
8 0
3 years ago
write a program that keeps names and email addresses in a dictionary as key-value pairs. the program should display a menu that
erma4kov [3.2K]

To write a program that keeps names and email addresses in a dictionary as key-value pairs check the code given below.

<h3>What is key-value pairs?</h3>

In a key-value pair, two related data elements are combined: a value, which is a variable that belongs to the set (for example, male/female, green, 100), and a key, which is a constant that defines the data set (for example, gender, color, price).

A key-value pair could look something like this when fully formed:

gender = male

color = green

price > 100

↓↓↓//<u>Python code</u>//↓↓↓

import pickle

import sys

try:

   f=open('email.dat','rb')

   d=pickle.load(f)  

   f.close()

     

except:    

   d={}

while True:

   print('\n1. Find a email address')

   print('2. Add name and email address')

   print('3. Change an email address')

   print('4. Delete an email address')

   print('5. Exit\n')

   choice=input('\nEnter a choice: ')

   if choice:

       choice=int(choice)

   else:

       print('\nEnter a number')

       continue    

   if choice == 1:

       while True:

           name=input('\nEnter the name ')

           if name:

               if name in d:

                   print('\n%s is the email id of %s \n' % (d[name],name))

                   break

               else:

                   print('\n Email not found \n')

                   break

           else:

               print('\nName cannot be empty\n')

               continue

           

   elif choice==2:

       while True:            

       

           name=input('\nEnter the name ')

           if name:

               break;

           else:

               print('\nName cannot be empty \n')

               continue

       while True:            

       

           email=input('\nEnter the email address ')

           if email:

               d[name]=email

               break

           else:

               print('\nEmail cannot be empty\n')

               continue

           

   elif choice==3:

       while True:            

       

           name=input('\nEnter the name to change the email address ')

           if name:

               if name in d:

                   email=input('\nEnter the new email address ')

                   d[name]=email

                   print('\nEmail address changed \n')

                   break;

               else:

                   print('\nName not found \n')

                   break

           else:

               print('\nName cannot be empty \n')

               continue

           

   elif choice == 4:

       while True:            

       

           name=input('\nEnter the name to remove ')

           if name:

               if name in d:

                   del d[name]

                   print('\nName and Email address removed \n ')

                   break;

               else:

                   print('\nName not found \n')

                   break

           else:

               print('\nName cannot be empty\n')

               continue

   elif choice == 5:

       

       f=open('email.dat','wb')

       pickle.dump(d,f)

       f.close()

       sys.exit()

   else:

       print('\nEnter a valid choice ')    

Learn more about key-value pair

brainly.com/question/29414672

#SPJ1

3 0
1 year ago
Other questions:
  • Within the hardware of the personal computer temporary memory is known as
    10·2 answers
  • I only want someones opinion on this not anything you would find in a book.
    7·1 answer
  • When Amy turns on her computer, she notices a burning smell. Smoke comes out of the case, and Amy immediately turns off her comp
    7·1 answer
  • Una bombilla de 40 w de potencia está encendida durante 10 horas. Calcular la energía que ha consumido en julios y en kw·h.
    12·1 answer
  • 2.27 LAB: Driving costs Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as
    14·2 answers
  • Nate wants to copy the style of his contact address to the normal template. Complete the paragraph to describe how he can access
    6·1 answer
  • Select the guidelines you should follow when creating a resume
    12·2 answers
  • Create a program that will read in a Salesperson name, employment status (1=Full-time AND 2=Part-time) and the sales amount.
    5·1 answer
  • View which is used to specify the tables fields , their data types and properties ​
    9·2 answers
  • PLEASE HELP ME!!! I REALLY NEED YOU TO HELP ME NOW!!!! THANKS!
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!