Posted on 2010-08-16
Hi - I have been given these algorithm fragments to examine and answer some questions:
put on hat ;
IF(weather is sunny)
put on sunglasses;
put on shoes;
What items of clothing will be put on a) when it is rainging and b) when it is sunny?
- I imagine that if it is rainging it would be the hat and shoes and if it is sunny it would be the hat, shoes and sunglasses.
Go to shop;
IF(today is Saturday)
buy weekly newspaper;
- What items will be purchased on a) Thursday b) Saturday?
I think that Thursday would be milk and bread and Saturday would be mild, newspaper, peanuts and bread.
Please could somebody just have a quick look at this and tell me if I'm on the right tracks and if not, let me know where I'm going wrong so that I can understand this.
Thank you in advance