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.
First write a function to initialize all mailbox doors to closed (you can use Boolean type for closed or not).
Next write a second function that will conduct what Peter did as described above.
Next write another function that will output all of the mailboxes whose doors are closed.
Next write the main function. In your main function, call all of the above three functions to find out the distribution of closed mailboxes for Peter.
A simple span beam with a uniformly distributed dead load of 1.1 k/ft, including the self-weight and concentrated dead loads of 3.4 kips and live loads of 6.0 kips at the...Jul 07 2020
13) McDonnell Douglas, a manufacturer of large commercial aircraft, raises its prices of aircraft by 10 percent. Boeing, another manufacturer of large commercial aircraft...May 06 2021
On June 30, Paisley Party Planners had a $35,000 balance in Accounts Receivable and a $3,252 credit balance in Allowance for Uncollectible Accounts. During July, Paisley ...Apr 24 2020
How has the separation of commercial banking and investment banking activities evolved through time? How does this differ from banking activities in other countries? (May 11 2020
The Theater Arts Guild of Dallas (TAG-D) employs five people in its Publication Department. These people lay out pages for pamphlets, brochures, magazines, and other publ...May 15 2021
1. Is recruiting nurses abroad a good idea for U.S. hospitals facing worker shortages? 2. Can you think of any cultural problems U.S. hospitals might encounter as a resu...Jun 03 2020
The labor force participation rates of women have rapidly increased since 1948.32) Fill in the missing values in the table of data collected in the household survey for D...Dec 05 2019
Discounts which reduce the price for customers who buy items for resale or to produce other goods areA) purchase discounts.B) purchases returns and allowances.C) trade di...Mar 16 2020
Using the information given in the case, come up with possible adjusting entries (if any) for fiscal year end 2017 and update the BS and IS accordinglyMay 22 2020
You have been requested to recommend one of the mutually exclusive industrial sanitation control systems that are given below. MARR is 18% per year. Assume that not havin...Dec 04 2019