2A. Consider an elevator with a maximum capacity of 10 people. People can always leave the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2A. Consider an elevator with a maximum capacity of 10 people. People can always leave the elevator anytime. However, people cannot enter the elevator if the total number of people (including those who are already in the elevator) exceeds the maximum of 10. Write a C program using a switch statement to perform the following operations: 1. 2. Add people: Reads the number of persons who want to enter the elevator. Allow them if the maximum capacity is not exceeded. Partial addition of persons into the elevator is not allowed. Display the total number of people in the elevator after adding them. Remove people: Removes people from the elevator. Display the total number of people in the elevator after removing them. Continuously display the above options until the user enters -1 to stop. 2B. Develop a C program to find the maximum distance between two neighboring a's in the input string using for loop. abcbc adghacbd mnbaba neighbouring a's with maximum distance max_distance value = 7 Page 1 of 3 2C. Illustrate the working of binary search to find 33 in the given set of numbers 6, 13, 14, 25, 33, 43, 51, 53, 64, 72, 84, 93, 95, 96, 97. Show all intermediate computations. 2A. Consider an elevator with a maximum capacity of 10 people. People can always leave the elevator anytime. However, people cannot enter the elevator if the total number of people (including those who are already in the elevator) exceeds the maximum of 10. Write a C program using a switch statement to perform the following operations: 1. 2. Add people: Reads the number of persons who want to enter the elevator. Allow them if the maximum capacity is not exceeded. Partial addition of persons into the elevator is not allowed. Display the total number of people in the elevator after adding them. Remove people: Removes people from the elevator. Display the total number of people in the elevator after removing them. Continuously display the above options until the user enters -1 to stop. 2B. Develop a C program to find the maximum distance between two neighboring a's in the input string using for loop. abcbc adghacbd mnbaba neighbouring a's with maximum distance max_distance value = 7 Page 1 of 3 2C. Illustrate the working of binary search to find 33 in the given set of numbers 6, 13, 14, 25, 33, 43, 51, 53, 64, 72, 84, 93, 95, 96, 97. Show all intermediate computations.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Python and most Python libraries are free to download or use, though many users use Python through a paid service. Paid services help IT organizations manage the risks associated with the use of...
-
Randy, Inc., can issue 3-month commercial paper with a face value of $1,500,000 for $1,450,000. Transaction costs will be $1,500. The effective annualized percentage cost of the financing, based on a...
-
Use the properties of integrals to verify the inequality without evaluating the integrals. a. b. (? (x 4 + 4) dx > 0
-
herokee Incorporated is a merchandiser that provided the following information: Number of units sold Selling price per unit Variable selling expense per unit Variable administrative expense per unit...
-
Water, considered an inviscid, incompressible fluid, flows steadily as shown in Fig. P3.99. Determine \(h\). Figure P3.99 Q = 4 ft/s h Air Water 0.5-ft diameter 1-ft diameter 3 ft
-
During the current year, merchandise is sold for $1,375,000. The cost of the merchandise sold is $880,000. a. What is the amount of the gross profit? b. Compute the gross profit percentage (gross...
-
BMX Company has one employee. FICA Social Security taxes are 6.2% of the first $137,700 paid to its employee, and FICA Medicare taxes are 1.45% of gross pay. For BMX, its FUTA taxes are 0.6% and SUTA...
-
We are asking you to take part in the Moral Machine ( https://www.moralmachine.net/ Links to an external site. ) experiment conducted by the MIT Media Lab. This experiment is part of their research...
-
Sleep King Manufacturing Company ( SKMC ) is a public manufacturing company specializing in the fabrication of mattresses. The company has been operating from its headquarters in Toronto since 1 9 9...
-
Seller owns a parcel of investment land which Seller purchased four years ago for $2,000. Seller sells it to Buyer under an arrangement where Buyer pays Seller $2,000 cash in the current year and...
-
Slow Inc. designs, manufactures and distributes high-end commercial packaging. Slow Inc. operates out of two manufacturing facilities, one in Ottawa specializing in paper-based products and one in...
-
Davis Manufacturing Corporation applies manufacturing overhead on the basis of 1 5 0 % of direct labor cost. An analysis of the related accounts and job order cost sheet indicates that during the...
-
Dental Diversity provides three basic service appointments; Cleaning, Check-up, and Full service. Total annual costs average $7,200,000. An RVU analysis indicates the following: Annual Average...
-
Write a Marketing Management Discussion paper on Word of Mouth Marketing?
-
Discuss the information available from the following techniques in the analysis of inorganic pigments used in antique oil paintings: (i) Powder X-ray diffraction, (ii) Infrared and Raman...
-
Determine whether each of the following statements is true or false: Management accountants often work in cross-functional teams throughout the organization.
-
Determine whether each of the following statements is true or false: The internal audit function reports to the audit committee of the board of directors.
-
Determine whether each of the following statements is true or false: Management accountants are now more often looked upon as internal business advisors rather than bean counters recording historical...
Study smarter with the SolutionInn App