In this session we look at IPO as a programmatic problem-solving approach, use anIPO chart tool, and introduce Ruby - you'll even develop your first program in Ruby!
1. IPO and Intro to Ruby Class 4 – Programmatic Problem-Solving
2. Introduction Problem Solving Approaches Mathematic Algorithmic Heuristic IPO: The black box The Language of Logic
3. Agenda Warm-up: Brain Teasers Review Assignment I /Complete Week 3 IPO and Problem Solving Installing and Running Ruby An introduction to Ruby Programming Variables and Data Types Methods: Puts and Gets String Methods Assignment II: Binary & Hexadecimal
4. IPO & Problem Solving IPO – a programmatic approach Problem Statement Output Input Process Notation Additional Information Diagram Approach Solution & Check
5. IPO Problem Solving - Practice Exercise: Confusion at the Restaurant What is the problem? What would the output look like? What inputs do you have? Process & Approach? Check?
6. IPO Problem Solving - Practice Exercise: Confusion at the Restaurant Debrief Issues with problem? Obstacles? Solution before Process? Innovation? Other points?
7. Introducing Ruby What is Ruby and how does it differ from other languages? Where do you get Ruby? How do you install it? Unique college lab setups Testing installation C:gt; ruby –v Ruby development environments- RDE, etc.
8. Ruby Programming Basics Data Types: Integer, Float, String Methods: Puts and Gets Your first program!: Hello, World Variables: Assignment Arithmetic Operations String Methods: to_s, .to_i, .to_f , .capitalize, .reverse, upcase, downcase, .center(xx)
9. Summary IPO Ruby Installing Environment variables Programming basics, methods Next Topic: Set Theory, Venn Diagrams
We have discussed the idea before that there are many approaches to problem-solving, and one of the things that good problem-solvers must do, is to identify strategies for when to use one approach over another. Some of the approaches we have identified include:…One approach that we will look at today is inspired by the black-box philosophy of PS: that given the input and understanding what form the output should take, the task of solving a problem comes down to processing that input to become output. All you need are strategies and tools to set up the processing…and that process generally uses one or more of these methods.Learning to express oneself in terms of an algorithmic solution, requires us to use specific “language” of logic – both in terms of setting up the problem and using the language of the processing environment. Today we will experiment with an IPO tool to begin familiarizing ourselves with the idea of algorithmic approaches and we hope to even apply this a little (and begin learning a new language) in the Ruby environment.
So here is what I propose for an agenda…OK?
HANDOUT: IPO sheet…use a dimensional analysis exercise as a sample: how many tsp in a quart?IPO is a form of system analysis…always start a programmatic problem by doing the analysis or else you will waste time later as you near a solution. Having a clear understanding where you are going and how will almost always benefit you in time, effort and frustration.Problem Statement – Rephrase in your own words (this may be the most important step as per dimensional analysis)Output – what is the form of the output? What is the measure, what level of accuracy, what format: report/table/list?Input – not all info is useful inputNotation – set up variables, symbols, scopeDiagram – Flowchart? Table? Image? Characters?Approach – mathematical problem? Deduction? Induction? Substitutions? Rules/laws? Assumptions?Solution & Check – what would prove the solution?
Programmatic is methodic – take it one step at a time…DO NOT TRY TO SOLVE THIS PROBLEM (until you have done the analysis).
Any problem stating the problem? Let’s hear your statements. Feedback on that?Any obstacles in creating the statement or filling in any other information? How many wanted to get right at the solution rather than setting up the analysis?What innovations did you consider? What were your approaches? Anyone have any other approaches?…
Ruby is an open source programming environment and interpreted language - not compiled - requires an interpreter (ruby.exe)Ruby on Flash – downloading and unpackingSetting Path - getting batch files from my site - running the batch filesTesting the installation with command promptDownloading and running RDE (setting the path again?)
Integers for all whole numbers – negative and positiveFloats for decimal valuesString for most things – and default for RubyFire up RDE and do a quick programputs “Hello, World” or puts ‘hello,world!’ (form of quotes is important, but not of interest right now)SAVE the file as an .rb in your rubygems folder (on the flash drive root preferably)
So here is what we covered in this lesson…Next lesson…