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
Genrish500 [490]
3 years ago
15

Write a function to find the factors of an input number. The function should have one input n and a single output of a vector wh

ose entries are the factors of n. The only built in functions you are allowed to use are mod or rem (I would prefer mod). Demonstrate that your function works as expected.
Engineering
1 answer:
Hoochie [10]3 years ago
6 0

The following is the program.                                                          

<u>Explanation</u>:

  • We should  find the factors of input number
  • We can use  python to find the factors of input number
  • In this program, we can use the mod function.

def print_factors(y):

   print("The factors of",y,"are:")

     for j in range(1, y + 1):

          if y % j == 0:

                print(j)

num = 320

print_factors(num)

The above program calculates the factors of n. Here def is called as define function. We are calculating the factors of y. After that, we are giving them for the condition. If the condition is true it will print the factors of y.

                                   

You might be interested in
suppose we number the bytes in a w-bit word from 0 (less significant) to w/8-1 (most significant). write code for the followign
sammy [17]

Solution:

typedef  unsigned  char  *byte_pointer;

static int  int_of_bit  (byte_pointer x,  int  loc)

{

                  return(x[loc] << loc*8);

}  

static int  replace_byte(unsigned int a,  int loc,  unsigned int  b)

    unsigned int a_loc = int_of_bit((byte_pointer) &a ,  loc);

    unsigned int b_loc = (b  <<  loc*8);

 

     a  -=  a_loc;

      a  += b_loc;

      return a;

}

Explanation:

This takes two ints in hex format, one with 8 bits (0x00000000) and one with 2 bits (0x00) then places the 2 bit hex into the 8 bit at a given location.

EX:  replace_byte(0x00000000, 1, 0xFF) return 0x0000FF00

First thing first, it looks like you have some mixup:

" one with 8 bits (0x00000000) and one with 2 bits (0x00)*- what you mean is nibble not bits. Each hex character (0-9, A-F) represent 4 bits (16 possible combination), and is called a "nibble".

0x0000000 is 4 bytes. 0x00 is 2 bytes.

Next, you say "takes two ints in hex format" - your function takes two ints in any format. You're just choosing tp express them in hexidecimal. C++ doesn't care if you specify numbers in hex, decimal, octal, binary, etc.

8 0
4 years ago
A smelter emits SO2 at a rate of 10,000 kg/day. The stack is 200 m tall and the plume rise is 100 m. The windspeed is 2 m/s at a
Olegator [25]

Answer:

lol

Explanation:

lol

5 0
4 years ago
Air flows at 45m/s through a right angle pipe bend with a constant diameter of 2cm. What is the overall force required to keep t
HACTEHA [7]

Answer:

b)1.08 N

Explanation:

Given that

velocity of air V= 45 m/s

Diameter of pipe = 2 cm

Force exerted by fluid  F

F=\rho AV^2

So force exerted in x-direction

F_x=\rho AV^2

F_x=1.2\times \dfrac{\pi}{4}\times 0.02^2\times 45^2

F=0.763 N

So force exerted in y-direction

F_y=\rho AV^2

F_y=1.2\times \dfrac{\pi}{4}\times 0.02^2\times 45^2

F=0.763 N

So the resultant force R

R=\sqrt{F_x^2+F_y^2}

R=\sqrt{0.763^2+0.763^2}

R=1.079

So the force required to hold the pipe is 1.08 N.

3 0
4 years ago
a torque of 24 ft pounds is the result when a force of ______ pounds is applied to a wrench that is 18 inches long.​
andrew-mc [135]

Answer:

  16

Explanation:

The product of feet and pounds is the torque. 18 inches is 1.5 feet.

  (1.5 ft)(x lbs) = 24 ft·lbs

  x lbs = (24 ft·lbs)/(1.5 ft) = 16 lbs

The force will be 16 pounds applied to an 18-inch wrench to obtain 24 ft·lbs.

5 0
3 years ago
Read 2 more answers
A small vehicle is powered by a pulsejet. The available net thrust is 6000 N and the traveling speed is 200 km/hr. The gases lea
kumpel [21]

Answer:

a) The mass flow rate is 19.71 kg/s

b) The inlet area is 0.41 m²

c) The thrust power is 333.31 kW

d) The propulsive efficiency is 26.7%

Explanation:

Please look at the solution in the attached Word file.

Download docx
4 0
3 years ago
Other questions:
  • 4. A 25 km2 watershed has a time of concentration of 1.6 hr. Calculate the NRCS triangular UH for a 10-minute rainfall event and
    8·1 answer
  • You are ordering steel cable for a 250 foot long zip-line you are building in your back yard. The cable can be ordered in diamet
    6·2 answers
  • Assuming Stokes behavior, calculate the terminal settling velocity in standard air () for the following particles: (a) diameter
    5·1 answer
  • A tailgate may have a latch on both sides.<br> O True<br> O False
    10·2 answers
  • Which of the following describes what a manufacturing engineer does
    9·2 answers
  • PLZ HELP ASAP!!!
    6·1 answer
  • State two faults that are common in a simple cell​
    6·2 answers
  • What substance does light travel through before putting water in the cup
    5·1 answer
  • When an electrical current develops between two dissimilar types of metal in the cooling system, this is called
    7·1 answer
  • 5. What number filter lens is recommended when welding with SMAW and using 1/8" (3.2 mm)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!