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
Hidiesjcfkesudfmjhtredcvbnm,lkjhgfdsuytrkduefkvke
Grace [21]

Answer:

THANKS FOR THE POINTS!!!!!!!

3 0
3 years ago
Read 2 more answers
IF IT REQUIRES A STEADY FORCE
ELEN [110]

Answer:

i believe it is 1625 newtons

Explanation:

I could be wrong but im assuming that it is 325 newtons per meter if not then the answer could be completely different

mark brainliest if you could

7 0
3 years ago
or a metal pipe used to pump tomato paste, the overall heat- transfer coefficient based on internal area is 2 W/(m2 K). The insi
igomit [66]

Answer: ok the best one would be letter s because it goes

Explanation:

467,,mm tubing should do

7 0
3 years ago
An equilibrium mixture of 3 kmol of CO, 2.5 kmol of O2, and 8 kmol of N2 is heated to 2600 K at a pressure of 5 atm. Determine t
garri49 [273]

Answer:

x_{CO}=0.0203\\x_{O_2}=0.0926\\x_{CO_2}=0.227\\x_{N_2}=0.660

Explanation:

Hello,

In this case, we consider the reaction:

CO(g)+\frac{1}{2} O_2(g)\rightleftharpoons CO_2

For which the law of mass action is expressed as:

Kp=\frac{n_{CO_2}}{n_{CO}*n_{O_2}^{1/2}} (\frac{P}{n_{Tot}} )^{1-1-1/2}

Whereas the exponents are referred to the stoichiometric coefficients in the chemical reaction. Moreover, in table A-28 (Cengel's thermodynamics) the natural logarithm of the undergoing reaction at 2600 K is 2.801, thus:

K=exp(2.801)=16.46

In such a way, in terms of the change x the equilibrium goes:

16.46=\frac{x}{(3kmol-x)*(2.5kmol-0.5x)^{0.5}} (\frac{5}{13.5kmol-0.5x} )^{-0.5}

Hence, solving for x:

x=2.754kmol

Thus, the moles at equilibrium:

n_{CO}=3-2.754=0.246kmol\\n_{O_2}=2.5-0.5(2.754)=1.123kmol\\n_{CO_2}=x=2.754kmol\\n_{N_2}=8kmol

Finally the compositions:

x_{CO}=\frac{0.246}{0.246+1.123+2.754+8} =0.0203\\\\x_{O_2}=\frac{1.123}{0.246+1.123+2.754+8} =0.0926\\\\x_{CO_2}=\frac{2.754}{0.246+1.123+2.754+8} =0.227\\\\x_{N_2}=\frac{8}{0.246+1.123+2.754+8} =0.660

Best regards.

7 0
4 years ago
A water tower that is 90 ft high provides water to a residential subdivision. The water main from the tower to the subdivision i
Softa [21]

Answer:

number of houses = 3751.243

Explanation:

given data

tower high H =  90 ft

pipe length L = 3 mile

pipe dia d = 6 in

solution

we consider here loss is neglected by dia 6 in pipe

so we apply here bernaulis equation from top to bottom height 90 ft

\frac{P1}{\rho g} + \frac{V1^2}{2 g} + Z1 = \frac{P2}{\rho g} + \frac{V2^2}{2 g} + Z2      ..........................1

here P1 is = o gauge pressure

and P2 = 30 Psi  = 206.843 × 10^{3} Pa

and Z1 = 27.432 m

and Z2 = 0 and V1 = 0

so from equation 1

0+0+27.432 = \frac{206.843*10^3}{1000*9.81} × \frac{V2^2}{2*9.81}

solve we get

V = 11.16 m/s

V = 36.6 ft/s

and

flow will be here

flow Q = AV     ............2

Q = \frac{\pi}{4} (0.15)^2 × 11.16

Q = 0.19723 m³/s

Q = 187562.157 gal/hr

we have given house  use maximum = 50 gal/hr

so total home served = \frac{total flow}{need 1 home}

number of houses = \frac{187562.157}{50}

so number of houses = 3751.243

5 0
4 years ago
Other questions:
  • Under certain conditions, wind blowing past a rectangular speed limit Sign can cause the sing to oscillate with a frequency omeg
    12·1 answer
  • What is the work required to deflect a linear spring (k=32 kN/m) by 120 cm?
    12·1 answer
  • Consider a system with two tasks, Task1 and Task2. Task1 has a period of 200 ms, and Task2 has a period of 300 ms. All tasks ini
    5·1 answer
  • 15. A cold-chamber die-casting machine operates automatically, supported by two industrial robots.The machine produces two zinc
    9·2 answers
  • Calculate the density of the FCC nickel lattice with an interstitial hydrogen in the centered position of the unit cell. You may
    10·1 answer
  • Sam promises to pay Sandy $2,000 in four years and another $3,000 four years later for a loan of $2,000 from Sandy today. What i
    8·1 answer
  • Assume, X Company Limited (XCL) is one of the leading 4th generation Life Insurance
    9·2 answers
  • Define engineer with work field​
    15·1 answer
  • List 3 specific things you can do with a screw gun (not just screw in screws)
    9·1 answer
  • A manufacturer has been asked to produce 100 customized metal discs with a particular pattern engraved on them. Which production
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!