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
agasfer [191]
4 years ago
12

g Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in bin

ary. For an integer x, the algorithm is:
Engineering
1 answer:
Phoenix [80]4 years ago
4 0

Answer:

The solution is written in Python

  1. binary = ""
  2. decimal = 13
  3. quotient = int(decimal / 2)  
  4. remainder = decimal % 2
  5. binary = str(remainder) + binary
  6. while(quotient >0):
  7.    decimal = int(decimal / 2)
  8.    quotient = int(decimal / 2)  
  9.    remainder = decimal % 2
  10.    binary = str(remainder) + binary
  11. print(binary)

Explanation:

Firstly, we declare a variable <em>binary</em> and initialize it with an empty string (Line 1). This <em>binary </em>is to hold the binary string.

Next, we declare variable <em>decimal, quotient </em>and<em> remainder </em>(Line 2-4). We assign a test value 13 to decimal variable and then get the first quotient by dividing decimal with 2 (Line 3). Then we get the remainder by using modulus operator, % (Line 4). The first remainder will be the first digit joined with the binary string (Line 5).  

We need to repeat the process from Line 3-5 to get the following binary digits. Therefore create a while loop (Line 7) and set a condition that if quotient is bigger than 0 we keep dividing decimal by 2 and calculate the quotient and remainder and use the remainder as a binary digit and join it with binary string from the front (Line 9-11).

At last, we print the binary to terminal (Line 13).

You might be interested in
Slovee plz asap<br> pzllzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Triss [41]

Answer:

can you zoom in

Explanation:

4 0
3 years ago
Read 2 more answers
The following figures were obtained in a standard tensile test on a specimen of low carbon steel with a circular sectional area:
liq [111]

Answer:

See Explaination

Explanation:

1)here for given stress strain curve graph is given as follows

where for getting stress,S=F/A=4F/(pi*(50*10^-3)^2)

for strain=e=dl/l=dl*10^-3/100 mm/mm or m/m

2)so graph is as follows

3)for getting youngs modulus of elasticity we must know slope of graph stress verses strain and for straight line in elastic region upto 12 point we have elastic region and from that we get E as

E=slope of graph for first 12 points=S/e=14.5665*10^9/.812=17.9390*10^9 N/m2

4)for getting ultimate tensile stress at which specimen bears maximum load without failure so we get UTS as

UTS=maximum load/area=40*10^6/1.9634=20.3728*10^6 N/m2

5)percentage reduction in area is given by

percentage reduction in area=[original area-final area/original area]*100

Percent reduction=[5062-10^2]*100/50^2=96%

6)percentage elongation is given by

percent elongation=[final length-original length/original length]*100

final length at fractureis=14.56+100=114.56 mm

so we get percent elongation as=[114.56-100/100]*100=14.56%

7)true fracture stress is given by load at fracture devided by true area at fracture

Sf=load/(true area)=4*28*10^3/(pi*(10*10^-3)^2)=356.5070*10^6 N/m2

8 0
4 years ago
A ball is dropped from rest from the top of a cliff that is 30 m high. From ground
trasher [3.6K]

The distance below the top of the cliff that the two balls cross paths is 7.53 meters.

<u>Given the following data:</u>

  • Initial velocity = 0 m/s (since the ball is dropped from rest).
  • Height = 30 meters.

<u>Scientific data:</u>

  • Acceleration due to gravity (a) = 9.8 m/s^2.

To determine how far (distance) below the top of the cliff that the two balls cross paths, we would apply the third equation of motion.

<h3>How to calculate the velocity.</h3>

Mathematically, the third equation of motion is given by this formula:

V^2 = U^2 +2aS

<u>Where:</u>

  • V is the final velocity.
  • U is the initial velocity.
  • a is the acceleration.
  • S is the distance covered.

Substituting the parameters into the formula, we have;

V^2 = 0^2 +2(9.8) \times 30\\\\V^2 = 588\\\\V=\sqrt{588}

V = 24.25 m/s.

<u>Note:</u> The final velocity of the first ball becomes the initial velocity of the second ball.

The time at which the two balls meet is calculated as:

Time = \frac{S}{U} \\\\Time = \frac{30}{24.25}

Time = 1.24 seconds.

The position of the ball when it is dropped from the cliff is calculated as:

y_1 = h-\frac{1}{2} at^2\\\\y_1 = 30-\frac{1}{2} \times 9.8 \times 1.24^2\\\\y_1 = 30-7.53\\\\y_1=22.47\;meters

Lastly, the distance below the top of the cliff is calculated as:

Distance = 30-22.47

Distance = 7.53 meters.

Read more on distance here: brainly.com/question/10545161

4 0
3 years ago
25 gallons of an incompressible liquid exert a force of 70 lbf at the earth’s surface. What force in lbf would 6 gallons of this
jekas [21]

Answer:

froce by 6 gallon liquid on moon surface is  2.86 lbf

Explanation:

given data:

at earth surface

volume of an incompressible liquid = Ve = 25 gallons

force by liquid = 70 lbf

on moon

volume of  liquid = Vm = 6 gallons

gravitational acceleration on moon is am = 5.51 ft/s2

Due to incompressibility , the density remain constant.

mass of liquid on surface of earth= \frac{ force}{ acceleration}

mass = \frac{70lbf}{32.2 ft/s2}

mass = 2.173 pound

density \rho = \frac{mass}{volume}

                  = \frac{2.173}{25} = 0.0869 pound/ gallon

froce by 6 gallon liquid on moon surface is

Fm = mass * acceleration

      = density* volume * am

      = 0.0869 *6* 5.51

      = 2.86 lbf

5 0
3 years ago
Air at 38°C and 97% relative humidity is to be cooled to 14°C and fed into a plant area at a rate of 510m3/min. (a) Calculate th
Katarina [22]

To develop the problem it is necessary to apply the concepts related to the ideal gas law, mass flow rate and total enthalpy.

The gas ideal law is given as,

PV=mRT

Where,

P = Pressure

V = Volume

m = mass

R = Gas Constant

T = Temperature

Our data are given by

T_1 = 38\°C

T_2 = 14\°C

\eta = 97\%

\dot{v} = 510m^3/kg

Note that the pressure to 38°C is 0.06626 bar

PART A) Using the ideal gas equation to calculate the mass flow,

PV = mRT

\dot{m} = \frac{PV}{RT}

\dot{m} = \frac{0.6626*10^{5}*510}{287*311}

\dot{m} = 37.85kg/min

Therfore the mass flow rate at which water condenses, then

\eta = \frac{\dot{m_v}}{\dot{m}}

Re-arrange to find \dot{m_v}

\dot{m_v} = \eta*\dot{m}

\dot{m_v} = 0.97*37.85

\dot{m_v} = 36.72 kg/min

PART B) Enthalpy is given by definition as,

H= H_a +H_v

Where,

H_a= Enthalpy of dry air

H_v= Enthalpy of water vapor

Replacing with our values we have that

H=m*0.0291(38-25)+2500m_v

H = 37.85*0.0291(38-25)-2500*36.72

H = 91814.318kJ/min

In the conversion system 1 ton is equal to 210kJ / min

H = 91814.318kJ/min(\frac{1ton}{210kJ/min})

H = 437.2tons

The cooling requeriment in tons of cooling is 437.2.

3 0
3 years ago
Other questions:
  • The volume at a section of a 2-lane highway is 1800 vph in each direction and the density is approximately 30 bpm. A slow moving
    10·1 answer
  • Hello everyone, how can you draw this drawing?
    13·1 answer
  • Realiza las siguientes conversiones.
    12·1 answer
  • Plz help me
    12·1 answer
  • I got a rubber band car assigned as a project today. The goal is for the car to go farther/faster than the car my teacher is mak
    6·1 answer
  • La Patrulla Fronteriza de los Estados Unidos analiza la compra de un helicóptero nuevo para la vigilancia aérea de la frontera d
    14·1 answer
  • What is an adaptation?
    14·2 answers
  • Someone please help me<br> (I give out brainless)<br> This is due very soon
    5·1 answer
  • Two HVAC/R technicians are discussing the soldering of copper pipes. Technician A says that when soldering, it's important to ap
    14·1 answer
  • A master precision square is used to validate the
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!