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
Draw a flowchart to represent the logic of a program that allows the user to enter values for the current year and the user’s bi
Digiron [165]

Answer:

Please, see the attachment.

Explanation:

First, we have to create two input boxes that allows the user to write the current year in one of them and his/her birth year in the another one. Also, we have to create a label that will show the result of the desired variable. We can write a message "Your age is:" and it will be attached to the result.

For the algorithm, let's call the variables as follows:

CY = Current Year

BY = Birth Year

X = Age of user

When the user inserts the current year and his/her birth year, the program will do the following operation:

X = CY - BY; this operation will give us the age of the user

After this the user will see something like "Your age is:" X.

3 0
3 years ago
Explain with examples:<br> What are the reasons of a successful and unsuccessful software project?
malfutka [58]

Answer: Not Enough Time

Often, the deadline date is decided before the project starts and is non-negotiable. This deadline results in a headlong rush to get started on the assumption, the sooner you begin coding, the sooner you'll finish.

A rush to start coding is almost always the wrong approach. It is important to spend the time to create a good design. Not having a good design leads to continuing changes throughout the development phase. When this happens, time and budget are consumed at a rapid rate.

Solution: Make time to create a good design. Don't be tempted to jump straight in and begin coding. Assign time to this task and the rest of the project will run much better. It will improve your reputation when you deliver something that fulfils the customers' expectations and works the first time correctly.

Explanation:

3 0
3 years ago
A large heat pump should upgrade 5 MW of heat at 85°C to be delivered as heat at 150°C. Suppose the actual heat pump has a COP o
AysviL [449]

Answer:

W=2 MW

Explanation:

Given that

COP= 2.5

Heat extracted from 85°C  

Qa= 5 MW

Lets heat supplied at 150°C   = Qr

The power input to heat pump = W

From first law of thermodynamics

Qr= Qa+ W

We know that COP of heat pump given as

COP=\dfrac{Qr}{W}

2.5=\dfrac{5}{W}

2.5=\dfrac{5}{W}

W=2 MW

For Carnot heat pump

COP=\dfrac{T_2}{T_2-T_1}

2.5=\dfrac{T_2}{T_2-(273+85)}

2.5 T₂ -  895= T₂

T₂=596.66 K

T₂=323.6 °C

7 0
3 years ago
Given a mass-spring-damper system. The impulse response of strength 1 can be obtained from a unit step response by: ______
Alina [70]

Answer:

Multiplying impulse response by t  ( option D )

Explanation:

We can obtain The impulse response of strength 1 considering a unit step response by Multiplying impulse response by t .

When we consider the Laplace Domain, and the relationship between unit step and impulse, we can deduce that the Impulse response will take the inverse Laplace transform of the function ( transfer ) . Hence Multiplying impulse response by t will be used .

5 0
3 years ago
A constant-head permeability test gives the following information: - Water flows horizontally through the soil sample. - The hei
Marysya12 [62]

Answer:

Complete answer to the question is explained in the attached files.please have a look on it.

Explanation:

5 0
3 years ago
Other questions:
  • Consider the following class definitions: class smart class superSmart: public smart { { public: public: void print() const; voi
    6·1 answer
  • 1. What is an op-amp? List the characteristics of an ideal op-amp
    11·1 answer
  • A large prime number isP = 232582657 - 1
    8·1 answer
  • Determine the maximum volume in gallons​ [gal] of olive oil that can be stored in a closed cylindrical silo with a diameter of 3
    12·1 answer
  • If d=0.25m and D=0.40m. Assume headloss from the contraction to the end of the pipe can be found as hų = 0.9 (V is velocity in t
    8·1 answer
  • Fuel Combustion and CO2 Sequestration [2016 Midterm Problem] Long-term storage of carbon dioxide in underground aquifers or old
    5·1 answer
  • Why did fprtmiu78t7ty87uhyu
    12·1 answer
  • (4 points) What field of work generally requires (a) an engineer to have a Professional Engineer
    11·1 answer
  • I will mark brainliest.
    6·2 answers
  • Explain how to properly engage the safety latches on the Stan Design Pit Jack.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!