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
Anvisha [2.4K]
3 years ago
5

You recall an algorithm from elementary school for factoring a number N: Divide out all factors of 2, then of 3, then of 4, then

of 5, then of 6, then of 7, etc. Finally, divide out all factors of N (of which there can be at most one). (a) Write pseudo-code for this algorithm (and print the prime factors)
Engineering
1 answer:
Contact [7]3 years ago
4 0

Answer:

let number = 0

while number < 1

  begin

     print "Enter a positive integer: "

     read number

  end

end_while

find and print number's factors:

let prime = TRUE

let currentFactor = 2

let lastFactor = the square root of number truncated

  to an integer value

while currentFactor <= lastFactor

  begin

     if number is evenly divisible by currentFactor

        begin

           print currentFactor

           let number = number / currentFactor

        end

     else

        let currentFactor = currentFactor + 1

     end_if

  end

end_while

print a message if number is prime:

if prime == TRUE

  print "Your number is prime"

end_if

Explanation:

You might be interested in
1. Consider a city of 10 square kilometers. A macro cellular system design divides the city up into square cells of 1 square kil
kakasveta [241]

Answer:

a) n = 1000\,users, b)\Delta t_{min} = \frac{1}{30}\,h, \Delta t_{max} = \frac{\sqrt{2} }{30}\,h, \Delta t_{mean} = \frac{1 + \sqrt{2} }{60}\,h, c) n = 10000000\,users, \Delta t_{min} = \frac{1}{3000}\,h, \Delta t_{max} = \frac{\sqrt{2} }{3000}\,h, \Delta t_{mean} = \frac{1 + \sqrt{2} }{6000}\,h

Explanation:

a) The total number of users that can be accomodated in the system is:

n = \frac{10\,km^{2}}{1\,\frac{km^{2}}{cell} }\cdot (100\,\frac{users}{cell} )

n = 1000\,users

b) The length of the side of each cell is:

l = \sqrt{1\,km^{2}}

l = 1\,km

Minimum time for traversing a cell is:

\Delta t_{min} = \frac{l}{v}

\Delta t_{min} = \frac{1\,km}{30\,\frac{km}{h} }

\Delta t_{min} = \frac{1}{30}\,h

The maximum time for traversing a cell is:

\Delta t_{max} = \frac{\sqrt{2}\cdot l }{v}

\Delta t_{max} = \frac{\sqrt{2} }{30}\,h

The approximate time is giving by the average of minimum and maximum times:

\Delta t_{mean} = \frac{1+\sqrt{2} }{2}\cdot\frac{l}{v}

\Delta t_{mean} = \frac{1 + \sqrt{2} }{60}\,h

c) The total number of users that can be accomodated in the system is:

n = \frac{10\times 10^{6}\,m^{2}}{100\,m^{2}}\cdot (100\,\frac{users}{cell} )

n = 10000000\,users

The length of each side of the cell is:

l = \sqrt{100\,m^{2}}

l = 10\,m

Minimum time for traversing a cell is:

\Delta t_{min} = \frac{l}{v}

\Delta t_{min} = \frac{0.01\,km}{30\,\frac{km}{h} }

\Delta t_{min} = \frac{1}{3000}\,h

The maximum time for traversing a cell is:

\Delta t_{max} = \frac{\sqrt{2}\cdot l }{v}

\Delta t_{max} = \frac{\sqrt{2} }{3000}\,h

The approximate time is giving by the average of minimum and maximum times:

\Delta t_{mean} = \frac{1+\sqrt{2} }{2}\cdot\frac{l}{v}

\Delta t_{mean} = \frac{1 + \sqrt{2} }{6000}\,h

8 0
3 years ago
Which of the following is most useful for doing research?
Ghella [55]

Answer:

Web Browser

Explanation:

Because you dont use a messaging app or presentation software to look up stuff its common knowledge

7 0
2 years ago
Water is the working fluid in an ideal Rankine cycle. Saturated vapor enters the turbine at 12 MPa, and the condenser pressure i
Brilliant_brown [7]

Answer:

\dot Q_{in} = 372.239\,MW

Explanation:

The water enters to the pump as saturated liquid and equation is modelled after the First Law of Thermodynamics:

w_{in} + h_{in}- h_{out} = 0

h_{out} = w_{in}+h_{in}

h_{out} = 12\,\frac{kJ}{kg} + 191.81\,\frac{kJ}{kg}

h_{out} = 203.81\,\frac{kJ}{kg}

The boiler heats the water to the state of saturated vapor, whose specific enthalpy is:

h_{out} = 2685.4\,\frac{kJ}{kg}

The rate of heat transfer in the boiler is:

\dot Q_{in} = \left(150\,\frac{kg}{s}\right)\cdot \left(2685.4\,\frac{kJ}{kg}-203.81\,\frac{kJ}{kg} \right)\cdot \left(\frac{1\,MW}{1000\,kW} \right)

\dot Q_{in} = 372.239\,MW

3 0
3 years ago
Read 2 more answers
Briefly explain how a jet moves
sergejj [24]

Answer:

Jet engines move the airplane forward with a great force that is produced by a tremendous thrust and causes the plane to fly very fast. All jet engines, which are also called gas turbines, work on the same principle. The engine sucks air in at the front with a fan. ... Spinning the turbine causes the compressor to spin.

Explanation:

yw

8 0
2 years ago
A material has the following properties: Sut = 275 MPa and n = 0.40. Calculate its strength coefficient, K.
Tems11 [23]

Answer:

The strength coefficient is K = 591.87 MPa

Explanation:

We can calculate the strength coefficient using the equation that relates the tensile strength with the strain hardening index given by

S_{ut}=K \left(\cfrac ne \right)^n

where Sut is the tensile strength, K is the strength coefficient we need to find and n is the strain hardening index.

Solving for strength coefficient

From the strain hardening equation we can solve for K

K = \cfrac{S_{ut}}{\left(\cfrac ne \right)^n}

And we can replace values

K = \cfrac{275}{\left(\cfrac {0.4}e \right)^{0.4}}\\K=591.87

Thus we get that the strength coefficient is K = 591.87 MPa

6 0
3 years ago
Other questions:
  • Suppose you are designing a sliding window protocol for a 1 Mbps point-to-point link to the moon, which has a one-way latency of
    10·1 answer
  • How does the clearance volume affect the efficiency of the Otto cycle?
    11·1 answer
  • 1. Represent each of the following combinations of units in the correct SI form using the appropriate prefix: (a) μMN, (b) N/μm,
    6·1 answer
  • Underlining words and highlighting dates are part of a student's personal note taking key.
    6·2 answers
  • Answer ppeeeeeaaaalll
    5·1 answer
  • Marie and James are bubbling dry pure nitrogen (N2) through a tank of liquid water (H2O) containing ethane (C2H6). The vapor str
    5·1 answer
  • A closed, rigid tank is filled with a gas modeled as an ideal gas, initially at 27°C and gauge pressure of 300 kPa. The gas is h
    9·1 answer
  • What type of plans have to do with earth, soil, excavation, and location<br> of a house on a lot?
    12·1 answer
  • Witch measuring tool would be used to determine the diameter of a crankshaft journal
    5·1 answer
  • Do the coil resistances have any effect on the plots?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!