Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction.

Similar presentations


Presentation on theme: "1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction."— Presentation transcript:

1 1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Session 2 Matrix Logic Pearson Custom Computer Science CSC 104 Nassau Community College CSC 104 Programming Logic and Problem Solving

2 2 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Brain Teaser Bill, Ken, and Mark are – not necessarily in this order – a kicker, a receiver, and a quarterback. The kicker, who is the shortest of the three, has never been married. Bill, who is Ken's father-in-law, is taller than the receiver. Who plays in which position?

3 3 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Solution :Since Bill is Ken's father-in-law, both Bill and Ken must be married. This leaves the only remaining person, Mark, to be the bachelor (and hence the kicker). Since Bill is taller than the receiver, Bill must not be the receiver. By process of elimination, we conclude that Bill is the quarterback. The remaining position (the receiver) goes to Ken. Therefore, Bill is the quarterback, Ken is the receiver, and Mark is the kicker.

4 4 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Matrix logic Matrix logic (or 2D chart) can be used as a way to organize information and help you eliminate possibilities in a systematic way

5 5 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Matrix logic A logic matrix sets up a one-to-one correspondence between the elements in a problem. When doing matrix logic it is VERY IMPORTANT to read the instructions, pay attention to detail, organize your thoughts, make notes, etc. Talk about auxiliary information (such as who is married to whom in the previous problem).

6 6 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Simple Matrix Problem Ted, Ken, Allyson and Janie (two married couples) each have a favorite sport: running, swimming, biking and golf. Given the following clues, determine who likes which sport. 1.Ted hates golf 2.Ken wouldn’t run around the block if he didn’t have to, and neither would his wife 3.Each woman’s favorite sport is featured in a triathlon 4.Allyson bought her husband a new bike for his birthday to use in his favorite sport

7 7 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Simple Matrix Problem SPORTS NAMES RunningSwimmingBikingGolf Ted Ken Allyson Janie Use “X” for “No” and “O” for “Yes”

8 8 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. ANSWER: Simple Matrix Problem SPORTS NAMES RunningSwimmingBikingGolf TedX O X KenX O AllysonO X JanieX O X Use “X” for “No” and “O” for “Yes”

9 9 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Larger Matrix Problem Tom, John, Fred and Bill are friends whose occupations are (in no particular order) nurse, secretary, teacher and pilot. They attended a picnic recently, and each one brought his favorite meat (hamburger, chicken, steak and hot dogs) to barbecue. From the clues below, determine each man’s occupation and favorite meat

10 10 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Larger Matrix Problem From the clues below, determine each man’s occupation and favorite meat. Tom is neither the nurse nor the teacher Fred and the pilot play in a jazz band together The burger lover and the teacher are not musically inclined Tom brought the hot dogs Bill sat next to the burger fan and across from the steak lover The secretary does not play an instrument or sing

11 11 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Larger Matrix Problem OCCUPATIONSMEAT NurseSctyTchrPilotBurgChknSteakHDog NAMES Tom John Fred Bill MEAT Burg Chkn Steak HDog

12 12 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Larger Matrix Problem From the clues below, determine each man’s occupation and favorite meat. Tom is neither the nurse nor the teacher. (Tom/Teacher, Tom/Nurse) Fred and the pilot play in a jazz band together. (Fred/Pilot) The burger lover and the teacher are not musically inclined. (Burger/Teacher) Also: Fred/Burger, Fred/Teacher, Pilot/Burger Tom brought the hot dogs. (X in rows, columns for Tom/Hot Dog) Bill sat next to the burger fan and across from the steak lover. (Bill/Burger, Bill/Steak KNOW ALL MEATS Also: Burger lover is not teacher or pilot -> john bought burgers -> john not teacher or pilot KNOW BILL IS TEACHER, TOM IS PILOT The secretary does not play an instrument or sing. (Fred/Secretary) KNOW FRED IS NURSE, JOHN IS SECRETARY

13 13 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Larger Matrix Problem OCCUPATIONSMEAT NurseSctyTchrPilotBurgChknSteakHDog NAMES Tom X X O XX X O John O O FredO XX X O Bill O XO X MEAT Burg O XX Chkn O X Steak O X X HDog O

14 14 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction to Programming Using Visual Basic 2012 international, open membership, not- for-profit technology standards consortium. Homework Complete the Scavenger Hunt Due next class Let me know if there are any issues


Download ppt "1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction."

Similar presentations


Ads by Google