Fill This Form To Receive Instant Help
Homework answers / question archive / Now that we have loops and decision making abilities, we can start creating some more advanced programs
Now that we have loops and decision making abilities, we can start creating some more advanced programs. While focusing on loops, but being able to use anything we've learned so far:
A bank has a shortage of tellers operating with only 5 tellers who serve a large number of customers. The bank tellers have a maximum capacity to serve 200 customers. Customers who come in late are redirected to another branch or are asked to come another day. The bank management makes calculations after every month and if the number of unattended customers reaches a third of those served, the bank employs another teller.
Step 1
To solve the above case, a for loop will be used. The method will entail iteration through the days in a given period. For each of the days, the number of ban customers served can be read on the console. Increasing the number of bank tellers can be done every month only if the number of customers is not served to exceed a third of the total customers the bank received. At this stage, an arithmetic operator for divisions with the remainder is used in 30 days of a month.
Step 2
If day 30 turns to be true, the system will then go ahead determined whether the number of unserved customers exceeds a third of the total customers the bank tellers served in the entire month. If the results are true, the bank will then add another bank teller to bridge the deficit.
Step 3
If the count of served customers is not greater than a third of those not served, the variable number of served customers is increased
Based on my learning experience and knowledge gained, I can confidently say that I have learned a lot and I consider myself adequately equipped to program the above case by myself.