Part A. Flow Charts Practice

Draw Flow Charts for the following:

1. Identify the loops and then identify the ifs. Finally, draw a flow chart for the following bits of pseudocode:

    1. open front cover of the book
      repeat until the book is done
          read left page
          read right page
          turn page
      close the book
    2. get the user's birth date.
      if birth date is today, print "happy birthday"
      otherwise, print "merry un-birthday"
    3. pour bowl of cereal
      repeat until bowl is done
          put spoon in bowl, get cereal
          put cereal in mouth and chew, shallow
      wash bowl and spoon
      put cereal and dishes away
    4. get the current jackpot of the lottery
      if the jackpot is over 5 million, buy a ticket
      otherwise buy a chocolate bar instead.
    5. if raining, put on your coat
      repeat until you arrive at school
          step with left foot
          step with right foot
      if wearing coat, remove coat and put in locker.

    6. if you are hungry
          find pot, add water
          put on stove
          repeat until water boils
              pick up lid
              look at water
              put down lid
          add kraft dinner
          repeat until noddles cooked
              pick out noodle, test it
              stir the noodles
          if you like milk, add it
          add butter
          add cheese
          stir
      otherwise, go watch tv.

2. Identify the loops and then identify the ifs. Finally, draw a flow chart for the following bits of pseudocode:

    1. set holder to be 0, set count to be 0
      repeat until you hit the end of the list of numbers
          add number to holder
          add one to count
      divide holder by count
      print average
    2. get the user's age
      if their age is over 18 print "you can vote"   
      else print "you can't vote"
    3. get base, exponent
      if exponent is negative, print `we can`t do that`
      otherwise, if exponent is 1, print 0
      otherwise,
          set holder = base
          repeat the number of times from 1 to exponent
              holder = holder*base
          print holder
    4. print class list code
      repeat for the entire class list
          print name
          get the next mark
          if the mark is over 90 write A+
          else if the mark is over 80 write A
          else if the mark is over 70 write B
          else if the mark is over 60 write C
          else if the mark is over 50 write D
          else write fail
      print end of class list

3. Draw a flow chart to draw a bulleseye. Make sure you use a diamond choice in your problem.

4. Draw a flow chart to represent someone making, distributing and analyzing a questionnaire. Make sure you use a diamond choice in your problem.

5. Draw a flowchart to print the song 100 bottles of pop on the wall. A section of the song follows:

100 bottles of pop on the wall
100 bottles of pop
If one of the those bottles should happed to fall
You'd have 99 bottles of pop on the wall

99 bottles of pop on the wall
99 bottles of pop
If one of those bottles should happen to fall
You'd have 98 bottles of pop on the wall

. . .

1 bottle of pop on the wall
1 bottle of pop
If that bottle of pop should happen to fall
You'd have no more bottles of pop on the wall


Part B. Computer History

Draw a flow chart for the old system and then draw one for a new system.


6. Banks and Cheques in the 1950s

The customer gets a book of cheques from the book. The customer writes a cheque and gives them to others. When the customer receives a cheque, they bring it to their bank. The bank gives the customer cash or deposits it into their account. Cheques are set aside.

At the end of the day/week/financial period, cheques are sorted by bank. The cheques are then totalled by hand. The sorting and totalling is done by hand or with the assistance of slow adding machines. The bank then contacts the other banks and the amounts they owe each other are compared and money is exchanged – by hand. (ignore branches for now)

Problem: At this point in history, the number of cheques that was being written increased dramatically. The 50s were a period of financial boom and many people who hadn’t previously needed a bank account opened one. Suddenly, the banks found that the volume was far too high to be handled manually.

 

7. Seat booking for American Airlines in 1960s

The booking was all done by one call centre. The centre is described as being “a huge room reminiscent of a war room”. There were 50 operators taking calls from customers who wished to buy tickets. Around the outside of the room were piles of airplane seating plans tacked up the wall. Each pile represented a destination-origin pair. All of the seating information of the flights between the two cities in the next two weeks were posted. When the operator took a call, s/he physically went to the part of the room were the appropriate seating information was posted. S/he flipped to the appropriate day and time and marked off a seat. Then the operator filled out a customer card noting the time, day and flight number and put it in a pile to be processed.

Later in the day, the pile of the cards was processed and bills and tickets were mailed to the customers. If however, the flight that the client wanted to book was more than two weeks hence, the operator hand to go into a huge room of filing cabinets and look up the flight that you wanted and mark it off there. S/he then filled out a card.

Problems: A lot of human errors in the booking process. This resulted in many inconsistencies and inaccuracies. The room was just too noisy and there was too many ways for the operators to make mistakes. In fact, it was said that if you were going to book a flight on a Friday or holiday, that you needed to book two tickets – then you could be assured that at least one of them would be right. American Airlines was losing a lot of money by flying half empty planes (due to the two-seat ticket booking technique) or by losing customers (who were mad that they didn’t have the seat they thought they booked).