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
The components of an electronic system dissipating 180 W are located in a 1-m-long horizontal duct whose cross section is 16 cm
oee [108]

Answer:

a) The exit temperature is 39.25°C

b) The highest component surface is 132.22°C

c) The average temperature for air equal to 35°C is a good assumption because the air temperature at the inlet will increase due to the result in the heat gain produced by the duct and whose surface is exposed to a flow of hot.

Explanation:

a) The properties of the air at 35°C:

p = density = 1.145 kg/m³

v = 1.655x10⁻⁵m²/s

k = 0.02625 W/m°C

Pr = 0.7268

cp = 1007 J/kg°C

a) The mass flow rate of air is equal to:

m=\rho *V = 1.145*0.65=0.7443kg/min=0.0124kg/s

The exit temperature is:

T=T_{i} +\frac{Q}{m*c_{p} } =27+\frac{0.85*180}{0.0124*1007} =39.25°C

b) The mean fluid velocity is:

V_{m} =\frac{V}{A} =\frac{0.65}{0.16*0.16} =25.4m/min=0.4232m/s

The hydraulic diameter is:

D_{h} =\frac{4A}{p} =\frac{4*0.16*0.16}{4*0.16} =0.16m

The Reynold´s number is:

Re=\frac{VD_{h} }{v} =\frac{0.4232*0.16}{1.655x10^{-5} } =4091.36

Assuming fully developed turbulent flow, the Nusselt number is:

Nu=0.023Re^{0.8} *Pr^{0.4} =0.023*4091.36^{0.8} *0.7268^{0.4} =15.69

h=\frac{k*Nu}{D_{h} } =\frac{0.02625*15.69}{0.16} =2.57W/m^{2} C

The highest component surface temperature is:

T=T_{e} +\frac{\frac{Q}{A} }{h} =39.2+\frac{0.85*\frac{180}{4*0.16*1} }{2.57} =132.22°C

6 0
4 years ago
Steam at 1400 kPa and 350°C [state 1] enters a turbine through a pipe that is 8 cm in diameter, at a mass flow rate of 0.1 kg⋅s−
sergeinik [125]

Answer:

Power output, P_{out} = 178.56 kW

Given:

Pressure of steam, P = 1400 kPa

Temperature of steam, T = 350^{\circ}C

Diameter of pipe, d = 8 cm = 0.08 m

Mass flow rate, \dot{m} = 0.1 kg.s^{- 1}

Diameter of exhaust pipe, d_{h} = 15 cm = 0.15 m

Pressure at exhaust, P' = 50 kPa

temperature, T' =  100^{\circ}C

Solution:

Now, calculation of the velocity of fluid at state 1 inlet:

\dot{m} = \frac{Av_{i}}{V_{1}}

0.1 = \frac{\frac{\pi d^{2}}{4}v_{i}}{0.2004}

0.1 = \frac{\frac{\pi 0.08^{2}}{4}v_{i}}{0.2004}

v_{i} = 3.986 m/s

Now, eqn for compressible fluid:

\rho_{1}v_{i}A_{1} = \rho_{2}v_{e}A_{2}

Now,

\frac{A_{1}v_{i}}{V_{1}} = \frac{A_{2}v_{e}}{V_{2}}

\frac{\frac{\pi d_{i}^{2}}{4}v_{i}}{V_{1}} = \frac{\frac{\pi d_{e}^{2}}{4}v_{e}}{V_{2}}

\frac{\frac{\pi \times 0.08^{2}}{4}\times 3.986}{0.2004} = \frac{\frac{\pi 0.15^{2}}{4}v_{e}}{3.418}

v_{e} = 19.33 m/s

Now, the power output can be calculated from the energy balance eqn:

P_{out} = -\dot{m}W_{s}

P_{out} = -\dot{m}(H_{2} - H_{1}) + \frac{v_{e}^{2} - v_{i}^{2}}{2}

P_{out} = - 0.1(3.4181 - 0.2004) + \frac{19.33^{2} - 3.986^{2}}{2} = 178.56 kW

4 0
3 years ago
Open the"stateData3.c" program and try to understand how the tokenization works. If you open the input file "stateData.txt", you
babymother [125]

Answer:

Kindly see explaination

Explanation:

Code

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#define size 200

int main(void)

{

int const numStates = 50;

char tempBuffer[size];

char tmp[size];

char fileName[] = "stateData.txt"; // Name of the text file (input file) which contains states and its populations

char outFile[] = "stateDataOutput1.txt"; // Output file name

// Open the input file, quit if it fails...

FILE *instream = fopen(fileName, "r");

/* Output File variable */

FILE *opstream;

if(instream == NULL) {

fprintf(stderr, "Unable to open file: %s\n", fileName);

exit(1);

}

//TODO: Open the output file in write ("w") mode

/* Opening output file in write mode */

opstream = fopen(outFile, "w");

//TODO: Read the file, line by line and write each line into the output file

//Reading data from file

while(fgets(tmp, size, instream) != NULL)

{

//Writing data to file

fputs(tmp, opstream);

}

// Close the input file

fclose(instream);

//TODO: Close the output file

/* Closing output file */

fclose(opstream);

return 0;

}

5 0
3 years ago
The 10 foot wide circle quarter gate AB is articulated at A. Determine the contact force between the gate and the smooth surface
slamgirl [31]

Answer:

F = 641,771.52 \dfrac{lb-ft}{s^2}

Explanation:

Given that

R=8 ft

Width= 10 ft

We know that hydro statics force given as

  F=ρ g A X

ρ is the density of fluid

A projected area on vertical plane

X is distance of center mass of projected plane from free surface of water.

Here

X=8/2  ⇒X=4 ft

A=8 x 10=80  ft^2

So now putting the values

F=ρ g A X

F=62.4(32.14)(80)(4)

F = 641,771.52 \dfrac{lb-ft}{s^2}

   

4 0
4 years ago
A Class A fire extingisher is for use on general combustibles such as:​
Tatiana [17]

Answer:

used for ordinary combustibles, such as wood, paper, some plastics, and textiles. This class of fire requires the heat-absorbing effects of water or the coating effects of certain dry chemicals.

Explanation:

7 0
3 years ago
Other questions:
  • Define various optical properties of engineering materials
    11·1 answer
  • A water jet jump involves a jet cross-sectional area of 0.01 m2 , and a jet velocity of 30 m/s. The jet is surrounded by entrain
    6·1 answer
  • Which of these is least likely a step in replacing a failed compressor?
    12·2 answers
  • The shear force diagram is always the slope of the bending moment diagram. a)True b)- False
    14·1 answer
  • (1) Estimate the specific volume in cm3 /g for carbon dioxide at 310 K and (a) 8 bar (b) 75 bar by the virial equation and compa
    10·1 answer
  • A steady state filtration process is used to separate silicon dioxide (sand) from water. The stream to be treated has a flow rat
    5·1 answer
  • Which of these credit building options do you personally think is the easiest method that you can see yourself doing? Explain yo
    8·1 answer
  • Which organisms are consumers in this food chain? List all that apply. *
    5·1 answer
  • thanh thẳng AD có kích thước và chịu lực như hình.biết P1 = 10kn, p2=5kn,M=15kn*m,a=2m.Hãy xách định phản lực liên kết tại A,b
    14·1 answer
  • Technician A says that a circuit with continuity reads 0 ohms. Technician B says that an open circuit reads 0 ohms. Who is corre
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!