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
Neko [114]
3 years ago
9

Peter the postman became bored one night and, to break the monotony of the night shift, he carried out the following experiment

with a row of mailboxes in the post office. These mailboxes were numbered 1 through 150, and beginning with mailbox 2, he opened the doors of all the even-numbered mailboxes, leaving the others closed. Next, beginning with mailbox 3, he went to every third mail box, opening its door if it were closed, and closing it if it were open. Then he repeated this procedure with every fourth mailbox, then every fifth mailbox, and so on. When he finished, he was surprised at the distribution of closed mailboxes. Write a program to determine which mailboxes these were.
Engineering
1 answer:
aleksandrvk [35]3 years ago
7 0

Answer:

//This Program is written in C++

// Comments are used for explanatory purpose

#include <iostream>

using namespace std;

enum mailbox{open, close};

int box[149];

void closeAllBoxes();

void OpenClose();

void printAll();

int main()

{

closeAllBoxes();

OpenClose();

printAll();

return 0;

}

void closeAllBoxes()

{

for (int i = 0; i < 150; i++) //Iterate through from 0 to 149 which literarily means 1 to 150

{

box[i] = close; //Close all boxes

}

}

void OpenClose()

{

for(int i = 2; i < 150; i++) {

for(int j = i; j < 150; j += i) {

if (box[j] == close) //Open box if box is closed

box[j] = open;

else

box[j] = close; // Close box if box is opened

}

}

// At the end of this test, all boxes would be closed

}

void printAll()

{

for (int x = 0; x < 150; x++) //use this to test

{

if (box[x] = 1)

{

cout << "Mailbox #" << x+1 << " is closed" << endl;

// Print all close boxes

}

}

}

Explanation:

You might be interested in
Water is being added to a storage tank at the rate of 500 gal/min. Water also flows out of the bottom through a 2.0-in-inside di
melomori [17]

Answer:

From the answer, the water level is falling (since rate of outflow is more than that of inflow), and the rate at which the water level in the storage tank is falling is

(dh/dt) = - 0.000753

Units of m/s

Explanation:

Let the volume of the system at any time be V.

V = Ah

where A = Cross sectional Area of the storage tank, h = height of water level in the tank

Let the rate of flow of water into the tank be Fᵢ.

Take note that Fᵢ is given in the question as 500 gal/min = 0.0315 m³/s

Let the rate of flow of water out of the storage tank be simply F.

F is given in the form of (cross sectional area of outflow × velocity)

Cross sectional Area of outflow = πr²

r = 2 inches/2 = 1 inch = 0.0254 m

Cross sectional Area of outflow = πr² = π(0.0254)² = 0.00203 m²

velocity of outflow = 60 ft/s = 18.288 m/s

Rate of flow of water from the storage tank = 0.0203 × 18.288 = 0.0371 m³/s

We take an overall volumetric balance for the system

The rate of change of the system's volume = (Rate of flow of water into the storage tank) - (Rate of flow of water out of the storage tank)

(dV/dt) = Fᵢ - F

V = Ah (since A is constant)

dV/dt = (d/dt) (Ah) = A (dh/dt)

dV/dt = A (dh/dt) = Fᵢ - F

Divide through by A

dh/dt = (Fᵢ - F)/A

Fi = 0.0315 m³/s

F = 0.0371 m³/s

A = Cross sectional Area of the storage tank = πD²/4

D = 10 ft = 3.048 m

A = π(3.048)²/4 = 7.30 m²

(dh/dt) = (0.0315 - 0.0370)/7.3 = - 0.000753

(dh/dt) = - 0.000753

4 0
3 years ago
NEED HELPASAP what is the moisture content of a board if a test sample that originally weighed 11. 5 oz was found to weigh 10 oz
Viefleur [7K]

Answer:

11.5-10/10= 0.15x100 =15%

Explanation:

3 0
2 years ago
Someone claims that in fully developed turbulent flow in a tube, the shear stress is a maximum at the tube surface. Is this clai
Alika [10]

Answer:

Yes this claim is correct.

Explanation:

The shear stress at any point is proportional to the velocity gradient at any that point. Since the fluid that is in contact with the pipe wall shall have zero velocity due to no flow boundary condition and if we move small distance away from the wall the velocity will have a non zero value thus a maximum gradient will exist at the surface of the pipe hence correspondingly the shear stresses will also be maximum.

5 0
3 years ago
Explain the difference between statically determinate beam and statically in determinate beam with sketch.
riadik2000 [5.3K]

Answer

Statically determinate beams are those beams in which the unknown reaction forces are equal or less than the equilibrium equation.

As shown in figure 1 in which reaction forces are 3 and we have 3 equilibrium equation so beam is determinate.

Statically indeterminate beams are those beams in which unknown reaction force are more than the  equilibrium equation.

As shown in figure 2 in which reaction forces are 6 and we have 3 equilibrium equation so beam is indeterminate.

5 0
3 years ago
Ext
Galina-37 [17]
Engineering is the technical
8 0
2 years ago
Other questions:
  • A curve with 0.3 m constant radius contains a bead that is moving on it such that its rotational velocity is 3t2 sec-1. If the b
    12·1 answer
  • The mechanical properties of a metal may be improved by incorporating fine particles of its oxide. Given that the moduli of elas
    11·1 answer
  • A 6cm OD, 2cm thick copper hollow sphere [k=386W/m.C] is uniformly heated at the inner surface at a rate of 150W/m2. The outside
    6·1 answer
  • The emissivity of galvanized steel sheet, a common roofing material, is ε = 0.13 at temperatures around 300 K, while its absorpt
    7·1 answer
  • A transmission line with an imperfect dielectric is connected to an ideal time-invariant voltage generator. The other end of the
    9·1 answer
  • Air expands through an ideal turbine from 1 MPa, 900 K to 0.1 MPa, 500K. The inlet velocity is small compared to the exit veloci
    10·1 answer
  • Given the circuit at the right in which the following values are used: R1 = 20 kΩ, R2 = 12 kΩ, C = 10 µ F, and ε = 25 V. You clo
    11·1 answer
  • BCC lithium has a lattice parameter of 3.5089 3 10–8 cm and contains one vacancy per 200 unit cells. Calculate (a) the number of
    13·1 answer
  • 1. ¿Cómo esta simbolizada la Cena en el Antiguo testamento?
    11·1 answer
  • Documentation of a flow chart?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!