Upcoming SlideShare
×

# Class 4 IPO and Intro to Ruby

902 views

Published on

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!

Published in: Education
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
902
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
0
0
Likes
0
Embeds 0
No embeds

No notes for slide
• 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 &amp; 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…
• The assignment due for next class is…
• ### Class 4 IPO and Intro to Ruby

1. 1. IPO and Intro to Ruby<br />Class 4 – Programmatic Problem-Solving<br />
2. 2. Introduction<br />Problem Solving Approaches<br />Mathematic<br />Algorithmic<br />Heuristic<br />IPO: The black box<br />The Language of Logic<br />
3. 3. Agenda<br />Warm-up: Brain Teasers<br />Review Assignment I /Complete Week 3 <br />IPO and Problem Solving <br />Installing and Running Ruby<br />An introduction to Ruby Programming <br />Variables and Data Types <br />Methods: Puts and Gets <br />String Methods<br />Assignment II: Binary & Hexadecimal<br />
4. 4. IPO & Problem Solving<br />IPO – a programmatic approach<br />Problem Statement<br />Output<br />Input<br />Process<br />Notation<br />Additional Information<br />Diagram<br />Approach<br />Solution & Check<br />
5. 5. IPO Problem Solving - Practice<br />Exercise: Confusion at the Restaurant<br />What is the problem?<br />What would the output look like?<br />What inputs do you have?<br />Process & Approach?<br />Check?<br />
6. 6. IPO Problem Solving - Practice<br />Exercise: Confusion at the Restaurant<br />Debrief<br />Issues with problem?<br />Obstacles?<br />Solution before Process?<br />Innovation?<br />Other points?<br />
7. 7. Introducing Ruby<br />What is Ruby and how does it differ from other languages?<br />Where do you get Ruby?<br />How do you install it?<br />Unique college lab setups<br />Testing installation<br />C:> ruby –v<br />Ruby development environments- RDE, etc.<br />
8. 8. Ruby Programming Basics<br />Data Types: Integer, Float, String <br />Methods: Puts and Gets <br />Your first program!: Hello, World<br />Variables: Assignment<br />Arithmetic Operations<br />String Methods: to_s, .to_i, .to_f , .capitalize, .reverse, upcase, downcase, .center(xx)<br />
9. 9. Summary<br />IPO<br />Ruby <br />Installing<br />Environment variables<br />Programming basics, methods<br />Next Topic: Set Theory, Venn Diagrams<br />
10. 10. Assignment<br />Assignment 2: Math Review II Binary/Hex<br />Due start of next class<br />Hand-in<br />