Upload
luyu
View
48
Download
3
Embed Size (px)
DESCRIPTION
Computer Programming as Baking Cookie. A “Recipe” for Computational Thinking in the context of ITEC1001 (and beyond) Informed and inspired by a STEM Grants Computational Thinking research conducted and published in Fall 2012 - PowerPoint PPT Presentation
Citation preview
PowerPoint Presentation
Computer Programming as Baking Cookie
A Recipe for Computational Thinking
in the context of ITEC1001
(and beyond)
Informed and inspired by a STEM Grants Computational Thinking
research conducted and published in Fall 2012
by Dr. Sebastien Siva, Dr. Stella Smith, and Dr. David Kerven
By Jesse Huang ([email protected]))
Computer Programming as Baking Cookie
1
1
Programming as Baking - TOC
Objectives
Notes on Delivery
Whats Computational Thinking?
Why flowchart? Picture worth thousand worlds.
Programming as Baking Evidences
Computational Thinking an Example
Computational Thinking the Evolution
Computational Thinking Vocabulary
Computational Thinking Reading
Computational Thinking Flowcharts
Computational Thinking Advanced Topic: Excel EMP()
Conclusion
Afterthought
Computer Programming as Baking Cookie
2
Programming as Baking - Prolog
Objectives:
an integrated lecture/activity module designed
To promote Computational Thinking in the context of ITEC by giving a series of focused hands-on demonstrations on computer programming (primary) and on digital media and web technology (secondary.)
To introduce computer programming as a fun, useful, easy and delicious undertaking in the hope of inspiring a deeper appreciation of and stronger passion toward information technology in general and software engineering in particular.
Computer Programming as Baking Cookie
3
Programming as Baking - Prolog
Objectives:
an integrated lecture/activity module designed
With adequate level of complexity (i.e. non-trivial; thus, a challenge), to show students Whats possible with ITEC, not to bog down with implementation details hoping to achieve programming proficiency in a few hours of lecture and activity.
Computer Programming as Baking Cookie
4
Programming as Baking - Prolog
Notes on delivery:
Divide the lesson into a series of 15-20-minute mini lectures/activities to be sprinkled throughout one semester, starting at about week-6, after MS Word module on myitlab, in tandem with TIA Chapter 4. Application Software coverage
Stress the fact from the outset that well use the Number Conversion problem merely as a well-defined, non-trivial but manageable problem serving as a vehicle for illustrating the concept and learning the process of computational thinking and problem-solving .
Be sympathetic; deliver with humility and patience
Computer Programming as Baking Cookie
5
Programming as Baking - Prolog
Computer Programming as Baking Cookie
6
Yummy Outcomes
Guaranteed!
Programming as Baking - Prolog
First, let me clarify what do I mean by saying
Computational Thinking
Computer Programming as Baking Cookie
7
Computational Thinking - Prolog
Computer Programming as Baking Cookie
8
Confucius (550 BC - 479 BC,
revered by most Chinese people as the
Master of All Teachers after him
he was declared the "Extremely Sage Departed
Teacher" (). He is also known
separately as the "Great Sage" (),
"First Teacher" (), and "Model Teacher for Ten Thousand Ages"
(). ) said (regarding his pupils):
Give them fish, and for 3 days they may survive. Give them fishing nets and teach them how to fish instead, they will live and thrive until the pond is dry.
Computational Thinking - Prolog
Here at SST, through the teaching of Computational Thinking, we, too, strive NOT to just give our students fishes (i.e. solutions to particular problems), but to teach them how to fish (i.e. general, algorithmic approaches to problem solving);
to give them recipes and show them how to make cookie cutters and bake cookies (i.e. computer programs, functions, procedures, etc.)
Computer Programming as Baking Cookie
9
9
Computational Thinking - Prolog
In the context of ITEC1001, for example, we will not stop at merely teaching our students a particular product such as MS Office productivity software for solving certain classes of problems (e.g. writing resume, PPT presentation),
but we will go further, through the introduction of computational thinking and algorithmic methodology, to also teach them a general, systematic approach to problem-solving.
Computer Programming as Baking Cookie
10
Computational Thinking - Prolog
In short, we are aspired to teach students
Not only How to Use software
e.g. MS Office productivity suites (fishes) in the context of general computing terminology
But also How to Make software
i.e. to apply computational thinking skill (fishing nets) to analyze problems and devise solutions; i.e. how to think like a programmer to overcome the learning curve when facing a given, unfamiliar software and/or technology
Computer Programming as Baking Cookie
11
Computational Thinking - Prolog
Loosely speaking, Computational Thinking may be viewed as a thought process for analyzing problems, recognizing patterns, and devising algorithmic solutions to the problems on hand. In other words, it is about the algorithmic way of thinking for analyzing problems and the systematic approach to the formation of solution.
http://www.voki.com/pickup.php?scid=8660682&height=267&width=200
More on Algorithmic Problem Solving at:
http://algorithmicproblemsolving.org/aps/
Computer Programming as Baking Cookie
12
Computational Thinking - Prolog
In the context of ITEC, I view
Computational Thinking
as:
Abstract thinking
Step-by-step procedural thinking
Divide-and-conquer thinking
Iterative thinking
Computer Programming as Baking Cookie
13
Computational Thinking - Prolog
Computational Thinking in K12 Education, teacher resources second edition
(as it appears on D2L Computational Thinking community)
Operational Definition
CT (Computational Thinking) is a problem-solving process that includes
(but is not limited to) the following characteristics:
Formulating problems in a way that enables us to use a computer and other tools to help solve them
Logically organizing and analyzing data
Representing data through abstractions such as models and simulations
Automating solutions through algorithmic thinking (a series of ordered steps)
Identifying, analyzing, and implementing possible solutions with the goal of achieving the most efficient and effective combination of steps and resources
Generalizing and transferring this problem-solving process to a wide variety of problems
These skills are supported and enhanced by a number of dispositions or attitudes that are essential dimensions of CT. These dispositions or attitudes include:
Confidence in dealing with complexity
Persistence in working with difficult problems
Tolerance for ambiguity
The ability to deal with open-ended problems
The ability to communicate and work with others to achieve a common goal or solution
Computer Programming as Baking Cookie
14
15
S4. Understanding Your Computer Computer System (Hierarchy) Overview
An example of abstract thinking:
Distilling the content of a one-semester course into a single flowchart
15
Computational Thinking - Prolog
In the context of ITEC, I have come to the following humble conclusions:
Computational Thinking
is
Computer Programming
The task of programming is very much like that of baking/cooking: take in a set of input (ingredients), follow the directions of recipes or cookbooks to process the ingredients, and produce output (e.g. cookies.)
Computer Programming as Baking Cookie
16
Computational Thinking - Prolog
As demonstrated by researches conducted by Drs. Siva, Smith, et al., computational thinking is a way of thinking and approach to solution, and it is best manifested by flowcharts.
Thus, we will use flowchart and a real computer program, Number Converter, to illustrate the application of algorithmic computational thinking process to solve a real-life problem,
Computer Programming as Baking Cookie
17
i.e. to convert numeral representation of a numeric value from one arbitrary base to another.
Computational Thinking - Prolog
Again, we want to stress the fact that well use the Number Conversion problem merely as a well-defined, non-trivial (reasonably complex), but manageable problem serving as a vehicle for illustrating the concept and learning the process of computational thinking and problem-solving
The lesson will be delivered as a series of 15-20-minute mini lectures/activities sprinkled throughout the semester
By the end of this lesson, students will not only learn or reinforce some valuable skills in problem-solving, but also get a glimpse of some fundamentals in computer programming
Computer Programming as Baking Cookie
18
Introduction
A flowchart is a type of diagram that represents an algorithm or process.
Shows the steps as boxes of various kinds, and their order with connecting arrows.
Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields.
(reused Dr. Sebastien Sivas slide)
A Sample Loop
Most students will need a C or better to complete the GGC Freshman Math Sequence.
Start
MATH 0099
MATH 1111
Stop
Is compass score above 36?
No
Yes
Is grade C or better?
Yes
No
(reused Dr. Sebastien Sivas slide)
Blackjack Exercise
The card game Blackjack requires the dealer to follow very specific rules for dealing cards to himself. He must deal one card face down, and then deal face up cards until his hand has a total score greater than 16. If his final score is greater than 21, then the dealer busts, else the dealer stands. Either way, his deal is complete.
Create a flow chart on the right hand side depicting the dealer process described above. Note, for this exercise, you do not need to know how a total score is calculated, simply include a step called calculate score.
(reused Dr. Sebastien Sivas slide)
Blackjack SolutionRemove fromStudent Copy
Start
Deal Face Down Card
Deal Face Up Card
Stop
Is score greater than 16
Yes
No
Is score greater than 21
BUST
Yes
STAND
No
Calculate Score
(reused Dr. Sebastien Sivas slide)
Computational Thinking - Prolog
Computer Programming as Baking Cookie
23
Why flowchart?
A picture is worth thousand words!
- By Hogben, Lancelot T., 1895 Mathematics for the Million
In mathematics, a percentage is a number or ratio expressed as a fraction of 100. It is often denoted using the percent sign, "%. Ex.: 6% means 6 parts/boxes out of (over) 100 parts/boxes.
Computational Thinking - Prolog
Computer Programming as Baking Cookie
24
- By Hogben, Lancelot T., 1895 Mathematics for the Million
Another examples:
Square of Sum of two quantities
Square of Difference of two quantities
Computational Thinking - Prolog
Computer Programming as Baking Cookie
25
Lessons to be learned (Variable vs. Content; Abstract vs. Concrete ):
Learn to think in general/abstract terms (from concrete to abstract):
Square of Sum of two quantities
Learn to translate general/abstract terms back into concrete representations (i.e. pictures, flowcharts)
An example from MyITlab Excel module -
Using the formula rate = amount of increase/base, insert a formula in cell C7 that will calculate the percentage that the population has increased between 1970 and 1980.
Programming as Baking - Evidences
Computer Programming as Baking Cookie
26
(Evidences: we call programming manuals as cookbooks)
Programming as Baking - Evidences
Computer Programming as Baking Cookie
27
(How many bits makes one bite ? Java refers to both a type of coffee and a programming language!)
Programming as Baking - Evidences
Computer Programming as Baking Cookie
28
(Thus why weve produced)
Programming as Baking - Evidences
Computer Programming as Baking Cookie
29
(But, if done right)
Programming as Baking - Evidences
Jelly Sandwich Cookies Recipe
Ingredients
2 cups Basic Cookie Dough
Assorted jellies or jams
Directions
On a lightly floured surface, roll out dough to 1/8-in. thickness. Cut with a 2-1/2-in. round cookie cutter. using a 1-1/2-in. cookie cutter of your choice, cut out the center of half of the cookies (discard centers).
Place whole cookies 2 in. apart on greased baking sheets. spread with 1 teaspoon jelly or jam; top with cutout cookies. Pinch edges with a fork to seal. Bake at 375 for 10-12 minutes or until edges are golden brown. Remove to wire racks to cool.
Yield
24 yummy Jelly Sandwich Cookies
Computer Programming as Baking Cookie
30
(To demonstrate, here is a recipe )
Programming as Baking - Evidences
Jelly Sandwich Cookies App
Ingredients (Input)
$Basic_Cookie_Dough = 2-cups ;
$jellies _or_jams = 1-p0rtion;
Directions (Process, Function/Method)
$Cookie_Sheet = Roll_out ( $Basic_Cookie_Dough , 1/8-in. thickness ); $Cookie_2-1/2 = CookieCutter.Cut ( 2-1/2-in, $Cookie_Sheet ); $Cookie_1-1/2 = CokkieCutter.Cut( 1-1/2-in., $Cookie_2-1/2, half at-enter); Discard ( $Cookie_1-1/2 );
Place ( $Cookie_2-1/2, 2 in. apart , on greased baking sheets); Spread ( 1 teaspoon jelly or jam, on $Cookie_2-1/2; top (with cutout cookies); Pinch (edges with a fork to seal.) Bake (at 375 for 10-12 minutes or until edges are golden brown.) Remove (to wire racks to cool.)
Yield (Output; eventually goes to our tummy for storage)
24 yummy Jelly Sandwich Cookies
Computer Programming as Baking Cookie
31
( converted to an app in PHP )
Programming as Baking - Evidences
All evidences point to one conclusion:
Computer Programming as Baking Cookie
32
Programming
Is
Baking/Cooking!
Programming as Baking - Evidences
making Cookie Cutters
Computer Programming as Baking Cookie
33
(Alright, maybe programming is not strictly making cookies but ...)
To automate, to enhance, to change the world and make it better, easier, faster (and make a lot of $money while doing it.)
Computational Thinking an Example
Number Converter
A web-based cookie cutter (i.e. program) that is built upon three basic ingredients to demonstrate the essence & power of computer programming (i.e. computational thinking.)
Computer Programming as Baking Cookie
34
Transforming
manual labor
Into
automation
Computational Thinking an Example
S.E.A.L. Challenge - Number Conversion
A guided learning expedition through a series of three S.E.A.L. (Student Engagement toward Active Learning) Challenges to illustrate the process of , and develop the skill in, computational thinking to solve a non-trivial but well-defined and manageable problem: to convert numbers from an arbitrary base to another.
Computer Programming as Baking Cookie
35
Ex. decimal to binary/hexadecimal, and back to decimal; binary to Base-80 and back, etc.
S.E.A.L. Challenges - Number Conversion
Challenge 04: Manual Approach to Number Conversion - with pencil & paper
Numeral versus Number (Value)
Convert numeral representation between various bases using pencil and paper to analyze the problem, and to devise or learn a solution
Challenge 05: Semi-computational Approach to Number Conversion - using Excel spreadsheet
Using Excel spreadsheet formulas to solve the problem
Expand the spreadsheet to support 32-bit number and extend the base to 80 using VLOOKUP() function
Challenge 06: Computational Approach to Number Conversion - with computer programming
Using the Number Converter program (cookie cutter)
Study the functionality, source code,
Draw flowcharts (reverse engineering) on the three major functions: Main driver, ConverToDecimal(), ConvertTo()
Computer Programming as Baking Cookie
36
Computational Thinking the Evolution
Computational Thinking the Evolution
Challenge 04: Manual Approach to Number Conversion - with pencil & paper
Work through the above activity/assignment to achieve the following learning objectives:
S.E.A.L. Challenge 04: Manual Approach to Number Conversion - with pencil & paper
Concepts & skills developed: Numeral versus Number(Value), Computational Thinking/Approach
Objectives:
To introduce, clarify, and/or illuminate the concept of Computational Thinking as an algorithmic approach or generalized procedure to problem-solving.
To develop, practice, and/or reinforce skills needed for further exploration of the discipline of Computational Thinking while setting the stage for developing a deeper appreciation for computer programming as an application of such thinking, which will be covered through a series of two separate but related exercises: 1.) Semi-Computational Approach to Number Conversion - using Excel spreadsheet and 2.) Computational Approach to Number Conversion - with computer programming.
To serve as a benchmark for contrasting the levels of effort needed between manual and computational approaches for problem-solving, thus highlight the benefit of efficiency and effectiveness gained by the latter.
By the conclusion of this assignment, students should demonstrate heightened appreciation regarding Computational Thinking as an iterative procedure that, like a good novel, has a begin, middle, and end, and by which certain process(es) can be repeated again and again until certain condition(s) is(are) met. It is this iterative nature of the procedure that lends itself nicely to be carried out by computer programming, thus lies in the heart of computational thinking.
Computer Programming as Baking Cookie
37
Computational Thinking the Evolution
Challenge 04: Manual Approach to Number Conversion - with pencil & paper
https://www.youtube.com/watch?v=qWxiXU02ZQM
(Non-computational/Limited approach)
https://www.youtube.com/watch?v=unYy2xRDm0o
(Non-computational/Limited approach)
https://www.youtube.com/watch?v=ZR0pC6_iW5Q
(Computational/Algorithmic/General approach)
Computer Programming as Baking Cookie
38
Computational Thinking the Evolution
Challenge 05: Semi-computational Approach to Number Conversion - using Excel spreadsheet
Computer Programming as Baking Cookie
39
Decimal to Binary:$QuotientDecimal -->$Base34567$Remainder02172831128641122432013221600421080052540062270072135082671923311021611128012240132201421015201Computational Thinking the Evolution
Challenge 06: Computational Approach to Number Conversion - with computer programming (cookie cutter)
Computer Programming as Baking Cookie
40
But, wait, wait, dont tell me: what is a cookie cutter?
Computational Thinking Vocabulary
Computer Programming as Baking Cookie
41
Simply put:
To learn computer programming (NOT software design/development/engineering) is to learn how to read, write, and think in a foreign language; its all about vocabulary & grammar
(Ex. An esoteric programming language INTERCAL)
It takes only patience and dedication to learn vocabulary & grammar in a foreign language.
Make clear about this point can encourage students to ask questions (there will be no stupid question) to promote true learning
41
What is Programming?
THREE
Basic
Ingredients
A computer program is a cookie cutter to make the world go faster and easier
To program is to write a series of computer instructions (recipe) to process (bake) certain input (data; ingredients) into some useful output (information; cookies)
Only THREE basic ingredients to make up a computer program:
Data & Structure: primitive data, record, array.
Operators : + -, *, /, etc.
Control Flow:sequence, selection, iteration
Computational Thinking Vocabulary
Ingredients #1: Data & Data Structure
Primitive Data
Variables that hold a single piece of data, such as
A number, e.g. $course_number = 1001; $credit_hour = 4;
A character, e.g. $initial = C; $grade = A;
A string, e.g. $cource_subject = ITEC;
Record (Class)
A group of variables containing Primitive Data to form a logical entity, such as
$course = {$course_subject, $course_number, $credit_hour, };
$contact_info = {$name, $address, $phone, $email, );
Array (Table)
A collection of Primitive Data or Record, such as
$base_10_numeral = {0, 1, 2, 3, , 9};
$base_2_numeral = {0, 1};
$course_catalog = {$course, $course,, $course};
$yellow_page = {$contact_info, $contact_info, , $contact_info};
Computer Programming as Baking Cookie
42
42
Computational Thinking Vocabulary
an important data structure: Array
Computer Programming as Baking Cookie
43
Google image Array of Dishes:
$numeral_map = array(
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', '!', '@', '#', '^', '&', '*', '(', ')',
'~', '[', ']', '{', '}', '|', '', '/', '?'
);
Index/Value0123101112131415676869777879Numeral0123ABCDEF*()>/?$numeral_map array looks like this:
To access an array element: $x = $numeral_map[0]; $y = $numeral_map[10]; etc.
Computational Thinking Vocabulary
Ingredients #2: Basic Operators
Computer Programming as Baking Cookie
44
SymbolOperation MeaningExampleStatement: Instruction or command to tell the computer what to do; e.g. $x = 100 + 10; means add 100 and 10 together and put the result into the memory location designated as $x. 123Numeric literalDefines a numeric value (i.e. can be computed)$x = 100 ;123String literalDefines a string value composed of characters (i.e. cant be computed(Hello World ; Bill Gate $xVariableDefines a memory (RAM) location (bucket) to hold value$x = 100; Assignment Operators:=AssignmentMoves the value on the right to the variable on the left$x = 100; Arithmetic Operators:+AdditionAdd two operands, returns the sum$x = 100 + 10; $x = $x + 20; (what is $x ?) SubtractionSubtract the right operand from the left, returns the difference$x = 100 10; $x = $x 20 (what is $x ? )*MultiplicationMultiplies two operands, returns the product$x = 100 * 10; $x = $x * 20 (what is $x ? )/DivisionDivide the left operand by the right, returns the quotient$x = 100 / 10; $x = $x / 20 (what is $x ? )%ModulusSame as Division, but return remainder instead$x = 105 % 10; $x = $x % 2 (what is $x ? )44
Computational Thinking Vocabulary
Ingredients #2: Basic Operators (continued)
Computer Programming as Baking Cookie
45
SymbolOperation MeaningExampleComparison and Conditional Operators:==Equal Is the left operand equal to the right operand? Return TRUE if yes$x = 100; $y = 30 + 70; if ($x == $y) {echo yes;} else {echo no;}!= Or Not equalReturn TRUE if NOT equal$x = 100; $y = 30 + 70; if ($x != $y) {echo yes;} else {echo no;}>Greater thanReturn TRUE if left operand is greater than the right$x = 10;While ($x > 5) {Print $x;$x = $x 1;} (What numbers get printed?)=Greater than OR equal toReturn TRUE if left operand is greater than OR equal to the right$x = 10;While ($x >= 5) {Print $x;$x = $x 1;} (What numbers get printed?) 0 ) {$remainder = (int)($quotient % $to_base);
$quotient = (int)($quotient / $to_base);
$numeral = $numeral_map[$remainder];
$to_numeral_arr[] = $numeral ;
}
$to_number = implode("",array_reverse($to_numeral_arr)); return $decimal_value;
}
Computer Programming as Baking Cookie
49
Ingredients #3: Control Flow (continued)
Computational Thinking Vocabulary
4. Function Call (GoTo) :
Computer Programming as Baking Cookie
50
Validate( $from_base, $from_number, $to_base );
if (empty($errors)) {
$to_number = ConvertTo( $from_base, $from_number, $to_base, $to_basex_steps );
}
For a function to work, it must first be defined, and then be called to execute. It usually returns values.
Ingredients #3: Control Flow (continued)
Computational Thinking Vocabulary
A function in computer programming is like a cookie cuter in cookie baking; it involves two steps
Step 1: Define a function (or design and make a cookie cutter):
mySuperDuperCookieCutter (shape) {
Cut a cookie in the shape as specified by the shape input parameter.
Return the cut cookie;
}
Step 2: Call (i.e. use ) the service of a function:
Cookie_basket = mySuperDuperCokkieCutter(star); // cut a star-shaped // cookie
Cookie_basket = mySuperDuperCookieCuter(round); // cut a round-shaped // cookie
, etc.
Computer Programming as Baking Cookie
51
For a function to work, it must first be defined, and then be called to execute. It usually returns values.
A special note about function -
Ingredients #3: Control Flow (continued)
Computational Thinking Reading
Now, lets dissect this number-converter
cookie cutter
My Computational Thinking supplement site
Computer Programming as Baking Cookie
52
PHP/Java Source
Computational Thinking Reading
Computer Programming as Baking Cookie
53
Number Converter code: main driver
$convert = isset( $_REQUEST['convert'] ); //has user submitted input form via //either GET or POST?
if ( $convert ) { //if yes...
//get user inputs
$from_base = $_REQUEST['from_base'];
$from_number = $_REQUEST['from_number'];
$to_base = $_REQUEST['to_base'];
Validate( $from_base, $from_number, $to_base );
if ( empty( $errors ) ) { //if no error
$to_number = ConvertTo( $from_base, $from_number, $to_base, $to_basex_steps );
} //else, fall through to display the page and error message at the bottom and //ask user to try again
} //else, this must be initial page hit;
//fall through to display the page at the bottom to ask use to submit input
PHP/Java Source
Computational Thinking Flowcharts
Computer Programming as Baking Cookie
54
Number Converter flowchart: Main() driver
PHP/Java Source
Computational Thinking Flowcharts
Computer Programming as Baking Cookie
55
Number Converter flowchart: ConvertTo() Function
PHP/Java Source
Computational Thinking Flowcharts
Computer Programming as Baking Cookie
56
Number Converter flowchart: ConvertToDecimalValue() Function
PHP/Java Source
Computational Thinking Advanced Topics
Alternatively or additionally, the class may dissect these programs:
Challenge 07: Dissecting Programs Implementing MS Excel Functions
My Computational Thinking supplement site
Computer Programming as Baking Cookie
57
Source
Computational Thinking Advanced Topics
Computer Programming as Baking Cookie
58
A Demo Implementation of Excel PMT() Function
What is a
Programmer?
It is not like these
Computer Programming as Baking Cookie
59
Computational Thinking Conclusion
2:30 AM
a Programmer is:
a
strives to recognize the challenges, the opportunities, the repetitive pattern of certain manual processes, and devises solutions to them
an
trained to construct programs (recipe, cookie cutter, computational solutions) to instruct computers to automate those manual processes
and, most of all
Computer Programming as Baking Cookie
60
Computational Thinking Conclusion
Computational-thinker
Software Engineer
Computational Thinking Conclusion
a Programmer, like a Chef, is:
a
who makes cookies (or cookie cutter; output) out of ingredients (input) following a set recipe (process, algorithm, procedure, method), to make the world faster, easier, and better.
Computer Programming as Baking Cookie
61
Problem-solver
and making a lot of $money
while doing it.
Chapter 1 Review:
Think about How we shop,
research, entertain, socializenowadays? None of these is possible without programmers.
Computational Thinking Conclusion
As a
a Chef relives the problem of hunger
a Programmer provides faster, easier, and better way to satisfy humankinds thirst for knowledge (e.g. Google, Wiki), entertainments (e.g. YouTube, games), connection & communication (e.g. Facebook, iPhone, email), and the infrastructure to support all of the above (i.e. Operating System, e.g. MS Window, Apple Mac OS, Unix/Linux), and much more
Computer Programming as Baking Cookie
62
Computational-thinker & Problem-solver
Computational Thinking Conclusion
Programming, like baking, is:
Computer Programming as Baking Cookie
63
Fun, Easy,
(a piece of cookie)
Useful,
& very Yummy indeed.
a potential gravy (or icing on a cookie?) of teaching Computer Programming as Baking Cookie is perhaps to attract more female ITEC majors to strengthen the representation of WIT (?)
Computer Programming as Baking Cookie
Computer Programming as Baking Cookie
64
Computer Programming as Playing Football
To encourage Men In Technology, perhaps we can present to our students that a programmer is like a quarterback in a football game
Computer Programming as Baking Cookie
65
Computer Programming as Playing Football
instead of talking about cookbook, well talk about playbook (so much more like flowchart or Entity-Relationship diagram?)
Computer Programming as Baking Cookie
66
Computer Programming as Baking Cookie
To program is to cook according to cookbooks (or to play according to playbooks, in order
Computer Programming as Baking Cookie
67
(Either way, it brings us to the same conclusion)
To automate, to enhance, to change the world and make it better, easier, faster (and make a lot of $money while doing it.)
Computer Programming as Baking Cookie
The End
Thank You for Your Indulgence.
Question?
Computer Programming as Baking Cookie
68
https://www.youtube.com/watch?v=vUEXMnBj-qY
Love Me With All Your Heart Engelbert H. Karaoke.mp4
Computational Thinking
Results from pilot implementation:
Students have developed deeper appreciation for information technology in general and for ITEC1001 course in particular; many expressed that those S.E.A.L challenges focused on the theme of computational thinking have enhanced their ITEC1001 learning experience.
Students have displayed heightened interest in software development and web technology; several students have approached me without solicitation for advises on future ITEC course and/or major; many have expressed wish to enroll into other ITEC courses taught by me.
Students have shown improvement in their computational / abstract thinking skill, and expressed desire to explore further.
It worked!
Computer Programming as Baking Cookie
69
Afterthought
Student Engagement toward Active Learning
Success Factors of a S.E.A.L. lecture/activity:
Design complex (non-trivial) but manageable: design it with adequate level of difficulty and complexity; make it a challenge, preferably with concrete, manageable example(s); too simple would make it boring; too complicated would induce frustration.
Delivery rigor but with humility: be sympathetic; mindful that we may have spent the better part of our adult life studying/practicing IT, ITEC1001 to most of our students is perhaps their first formal encounter with the subject matter; intimidation, even without intention, is not a recipe for falling in love at the first sight.
Computer Programming as Baking Cookie
70
Afterthought
Statement 1
Statement 2
...
Start
End
1. Sequence
If
Condition
true?
Statement(s)Statement(s)
...
...
Start
End
YesNo
2. Selection (Decision)
While
Condition
true?
Statement(s)
...
...
Start
End
YesNo
3. Iteration (Loop)
{ Definition& Invocation }
1Function in Computer Programming
Compiled by Jesse Huang, 10/05/2013
1.7 Construct
error message(s)
1.3
$convertbutton
pressed?
1.8 Draw the web page
1.1 Declare & initialize
variables, i.e.:
...
$errors= array();
...
$from_base = 10;
$from_number = "";
$to_base = 2;
$to_number = "";
...
Main Start
Main End
No(i.e. this is
initial page hit)
Yes(i.e. user has
submitted inputs)
1.2 Set up a $numeral_map
0.10.2
Initial
page
hit
$convert
button
pressed
HTML
HTML
Web browser
0.1
0.2
1.4Validate($from_base, $from_number,
$to_base)
i.e. user inputs
1.5
Any input error?
1.6 $to_number = ConvertTo($from_base,
$from_number, $to_base)
No(i.e. user input
are all valid)
Yes(e.g $from/$to_base
out of bound, invalid
numerals)
Number Converter Main()Driver (1)
2
2.3
$quotient > 0 ?
2.1 Declare & initialize
variables, i.e.:
...
global $numeral_map;
global $to_decimal_steps;
$to_numeral_arr = array();
$remainder = 0;
$quotient = 0;
...
Start
Return
No(i.e. $quotient reached zero)
2.2 $quotient =
ConvertToDecimalValue(
$from_base,
$from_number,
$to_decimal_steps);
2.4$remainder = ($quotient % $to_base);
Number ConverterConverTo()Function (2)
2
3
2.5$numeral = $numeral_map[$remainder];
2.6$quotient = (int)($quotient / $to_base);
Yes
2.7$to_numeral_arr[] = $numeral;
2.8 Assemble
$to_numeral_arrinto a
$to_numberstring with
correct most-significant-to-
least-significant order;
2
(functionreturn with
output $to_number)
(function call with 3 input
parameters: $from_base,
$from_number, $to_base)
3.3
$i >= 0 ?
(more digit to process ?)
3.1 Declare & initialize
variables, i.e.:
$decimal_value = 0;
$position_magnitude = 0;
$from_numeral_arr =
str_split($from_number);
$number_of_digit =
count($from_numeral_arr);
Start
Return
No(i.e. no more digit to process)
3.2 $i =highest position(defined as
$number_of_digit 1);
3.4 $exponent = $number_of_digit -$i 1;
Number Converter ConverToDecimalValue()Function (3)
3
3.5$multiplier = ToValue($from_numeral_arr[$i]);
3.6 $position_value = Power($from_base, $exponent);
3.7 $position_magnitude = ($multiplier * $position_value);
3
(functionreturn with
output $decimal_value)
(function call with 2 input
parameters: $from_base,
$from_number)
3.8 $decimal_value += $position_magnitude;
3.9 $i = $i -1;
Yes
For demo in computer programming class
Jesse Huang
Excel PMT() Implementation1