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
Structural engineers use wireless sensor networks to monitor the condition of dams and bridges.
qwelly [4]

Answer: True

Explanation:

Structural engineering is simply referred to as a branch of civil engineering, and they help in the designing of structures like buildings, dams, tunnels, bridges, tunnels, etc. Structural engineers typically work as consultants.

Wireless sensor networks are used by structural engineers to monitor the condition of dams and bridges. Wireless sensor network refers are dedicated sensors that are used in monitoring the physical conditions of the bridges and to know if they're still in good conditions.

8 0
3 years ago
Before finishing and installing a shelved cabinet you just constructed, you need to check the
Greeley [361]

Answer:

Carpenter's square

Explanation:

The most common hand tool used to measure or set angles with its application extending to setting angles of roofs and rafters. Another name of a Carpenter's square is a framing square.

Other hand tools that are used to measure angles are;

  • The combination square that allows a user to set both 90°  and 45° angles
  • A Bevel that allows users to set any angle they like.
  • A Protractor that resembles a bevel but its marks are marked in an arc.
  • An electromagnetic angle finder which gives a reading according to the measure of the arms adjusted by the user.
7 0
3 years ago
Technician A says that a fully charged battery is less likely to freeze than a discharged battery. Technician B says that the st
zheka24 [161]
Answer : Technician B is correct
8 0
3 years ago
A parallel plates capacitor is filled with a dielectric of relative permittivity ε = 12 and a conductivity σ = 10^-10 S/m. The c
monitta

Answer:

t = 1.06 sec

Explanation:

Once disconnected from the battery, the capacitor discharges through the internal resistance of the dielectric, which can be expressed as follows:

R = (1/σ)*d/A, where d is is the separation between plates, and A is the area of one of  the plates.

The capacitance C , for a parallel plates capacitor filled with a dielectric of a relative permittivity ε, can be expressed in this way:

C = ε₀*ε*A/d = 8.85*10⁻¹² *12*A/d

The voltage in the capacitor (which is proportional to the residual charge as it discharges through the resistance of the dielectric) follows an exponential decay, as follows:

V = V₀*e(-t/RC)

The product RC (which is called the time constant of the circuit) can be calculated as follows:

R*C = (1/10⁻¹⁰)*d/A*8.85*10⁻¹² *12*A/d

Simplifying common terms, we finally have:

R*C = 8.85*10⁻¹² *12 / (1/10⁻¹⁰) sec = 1.06 sec

If we want to know the time at which the voltage will decay to 3.67 V, we can write the following expression:

V= V₀*e(-t/RC) ⇒ e(-t/RC) = 3.67/10 ⇒ -t/RC = ln(3.67/10)= -1

⇒ t = RC = 1.06 sec.

3 0
3 years ago
⦁ An ideal Otto cycle has a compression ratio of 8. At the beginning of the compression process, air is at 95 kPa and 27°C, and
Anon25 [30]

Answer:

<u><em>note:</em></u>

<u><em>solution is attached in word form due to error in mathematical equation. furthermore i also attach Screenshot of solution in word due to different version of MS Office please find the attachment</em></u>

Download docx
8 0
4 years ago
Other questions:
  • Solve the compound inequality. 3x − 4 &gt; 5 or 1 − 2x ≥ 7
    8·1 answer
  • Description: Write a function that takes in a list of numbers and a list of indices. Note that indexList may not only contain va
    8·1 answer
  • A worker standing on a freshly mopped floor is
    7·1 answer
  • Create a program named IntegerFacts whose Main() method declares an array of 10 integers.Call a method named FillArray to intera
    12·1 answer
  • The rigid beam is supported by a pin at C and an A992 steel guy wire AB of length 6 ft. If the wire has a diameter of 0.2 in., d
    14·1 answer
  • Consider laminar, fully developed flow in a channel of constant surface temperature Ts. For a given mass flow rate and channel l
    15·1 answer
  • Fuel Combustion and CO2 Sequestration [2016 Midterm Problem] Long-term storage of carbon dioxide in underground aquifers or old
    5·1 answer
  • Select the correct answer.
    6·1 answer
  • “In a trusting relationship, confidential information is kept confidential.” Explain what the limits to confidentiality are and
    14·1 answer
  • A 1/20 scale model of a wing is used to determine forces on the actual airplane. the 1/20 scale refers to the:_____
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!