Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


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

English

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:

  1. Think of a problem that could be solved by using a loop - don't reuse the loan amortization example from the programming demo.
  2. What type of loop would you use to solve the problem (while, for, or do-while)?
  3. Using words (no programming required in this discussion), explain how you would go about solving the problem with a loop, in a series of steps.
  4. Taking what you listed in #3 as requirements, have we learned enough at this point in the class that you could program this yourself, and if not, what do you think you are lacking?

 

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

  1. Case scenario

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.

  1. The above scenario would be solved using for loop.
  2.   

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

  1.   

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.

Related Questions