Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CS 106, Winter 2009 Class 17, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,

Similar presentations


Presentation on theme: "1 CS 106, Winter 2009 Class 17, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,"— Presentation transcript:

1 1 CS 106, Winter 2009 Class 17, Section 4 Slides by: Dr. Cynthia A. Brown, cbrown@cs.pdx.educbrown@cs.pdx.edu Instructor section 4: Dr. Herbert G. Mayer, herb@cs.pdx.eduherb@cs.pdx.edu

2 2 Degrees of Learning We talk about “learning” something, but actually there are degrees of learning. These were explained in a classification system, called “Bloom’s taxonomy” There are six major categories, each dependent on the previous one

3 3 Bloom’s Taxonomy (1) Knowledge: Recall data or information. – Examples: Recite a policy. Quote prices from memory to a customer. Knows the safety rules. – Key Words: defines, describes, identifies, knows, labels, lists, matches, names, outlines, recalls, recognizes, reproduces, selects, states. Comprehension: Understand the meaning, translation, interpolation, and interpretation of instructions and problems. State a problem in one's own words. – Examples: Rewrites the principles of test writing. Explain in one’s own words the steps for performing a complex task. Translates an equation into a computer spreadsheet. – Key Words: comprehends, converts, defends, distinguishes, estimates, explains, extends, generalizes, gives examples, infers, interprets, paraphrases, predicts, rewrites, summarizes, translates.

4 4 Bloom’s taxonomy (2) Application: Use a concept in a new situation or unprompted use of an abstraction. Applies what was learned in the classroom into novel situations in the work place. – Examples: Use a manual to calculate an employeeís vacation time. Apply laws of statistics to evaluate the reliability of a written test. – Key Words: applies, changes, computes, constructs, demonstrates, discovers, manipulates, modifies, operates, predicts, prepares, produces, relates, shows, solves, uses. Analysis: Separates material or concepts into component parts so that its organizational structure may be understood. Distinguishes between facts and inferences. – Examples: Troubleshoot a piece of equipment by using logical deduction. Recognize logical fallacies in reasoning. Gathers information from a department and selects the required tasks for training. – Key Words: analyzes, breaks down, compares, contrasts, diagrams, deconstructs, differentiates, discriminates, distinguishes, identifies, illustrates, infers, outlines, relates, selects, separates.

5 5 Bloom’s taxonomy (3) Synthesis: Builds a structure or pattern from diverse elements. Put parts together to form a whole, with emphasis on creating a new meaning or structure. – Examples: Write a company operations or process manual. Design a machine to perform a specific task. Integrates training from several sources to solve a problem. Revises and process to improve the outcome. – Key Words: categorizes, combines, compiles, composes, creates, devises, designs, explains, generates, modifies, organizes, plans, rearranges, reconstructs, relates, reorganizes, revises, rewrites, summarizes, tells, writes. Evaluation: Make judgments about the value of ideas or materials. – Examples: Select the most effective solution. Hire the most qualified candidate. Explain and justify a new budget. – Key Words: appraises, compares, concludes, contrasts, criticizes, critiques, defends, describes, discriminates, evaluates, explains, interprets, justifies, relates, summarizes, supports.

6 6 Bloom’s Taxonomy Categories Knowledge Comprehension Application Analysis Synthesis Evaluation To be able to actually use knowledge, you have to get to at least the Application stage.

7 7 Example: Grammar Knowledge: I am able to tell you some rules of grammar, but when I actually write something, it might still be grammatically incorrect Application: I can use the rules of grammar to write grammatically

8 8 Business Processes Having good processes is important in many business situations – Think about how orders are processed at McDonald’s. It’s the same at every store all over the world, and they hardly ever make a mistake. – How is a loan application processed at a bank? Some ill-advised changes led to problems!

9 9 Our Goal: Process Design We want you to actually design a business process This means you can apply your knowledge to carry out the steps: – Develop requirements (use cases) – Develop tests based on the requirements – Design the user interface and identify the objects – Design the actual process using typical components

10 10 Process Components Event-driven structure A process may involve: – Sequential steps – Encapsulation of sub-processes (procedures and functions) – Conditional steps (various types of ifs) – Repetition (various types of loops)

11 11 Learning to Apply Loops Assignment 6 is about learning to apply loops Instead of having you write a program, it has you experiment with loops and observe their behavior You will write one small loop

12 12 Loop Review

13 13 For loop Repetitions are called loops in VB A For loop is used when we can determine the number of repetitions before starting the loop num = Cint(txtInput.Text) strNum = txtInput.Text lstMult.Items.Clear() Forj = I To 12 lstMult.Items.Add(strNum&“ x “ &CStr(j) &“ = “ & _ CStr(num * j)) Next

14 14 For loop version 2 Let’s modify the previous example so it prints a multiplication table up to N * N, instead of going to 12. num = Cint(txtInput.Text) strNum = txtInput.Text lstMult.Items.Clear() Forj = I To num ‘limits can be numbers, variables or expressions lstMult.Items.Add(strNum&“ x “ &CStr(j) &“ = “ & _ CStr(num * j)) Next

15 15 For Loop Syntax ForcVar = sValToeVal statements Next Here cVar is the control variable, sVal is the start value for cVar, and eVal is the end value for cVar cVar>eVal? Execute loop statements Increment cVar yes no cVar = sVal

16 16 The Do-While Concept Sometimes we can’t tell in advance how many times a loop will need to execute Or, it might just be clearer to use a logic that checks as we go along In that case we can use a Do loop instead of a For loop

17 17 Do-while example Let’s try the same program we did with the For loop, but this time with a Do-While loop num = Cint(txtInput.Text) strNum = txtInput.Text lstMult.Items.Clear() j = 1 Do While j<= 12 lstMult.Items.Add(strNum&“ x “ &CStr(j) &“ = “ & _ CStr(num * j)) j = j + 1 ‘what would happen if I forgot this line? Loop

18 18 Do-while example Here’s the n by n version num = Cint(txtInput.Text) strNum = txtInput.Text lstMult.Items.Clear() j = 1 Do While j<= num ‘note the upper bound is now a variable lstMult.Items.Add(strNum&“ x “ &CStr(j) &“ = “ & _ CStr(num * j)) j = j + 1 Loop What happens if num = 0?

19 19 Do Loop Syntax (While) Do While condition statement(s) Loop (Loop statements may never be done.) Condition true? Execute statements within the loop. Execute statements that follow the loop. No Yes

20 20 Do Loop Syntax (Until) Do statement(s) Loop Until condition (Loop statements are always done at least once.) Condition true? Execute statements within the loop. Execute statements that follow the loop. No Yes

21 21 BREAK 10 minutes

22 22 Nested Loops Remember how if statements can be “nested”: you can have an if inside another if We can also put whatever we want inside a loop, including another loop If we do this, the inner loop is executed completely, for all of its repetitions, each time the outer loop is executed once.

23 23 Example: Complete Multiplication Table Dim j, k As Integer Dim tableLine As String For j = 1 To 12 tableLine = “” For k = 1 To 12 tableLine = tableLine & CStr( j ) & “ x “ _ & CStr( k ) & “ = “ & CStr( j * k ) & “ “ Next ‘k lstMult.Items.Add( tableLine ) Next ‘j

24 24 Recursion Recursion is a powerful technique for thinking about a process It can be used to simulate a loop, or for many other kinds of applications In recursion, a function or procedure calls itself Obviously, there is a danger of an infinite regress, so there has to be a test for stopping it, and something (usually a parameter) must change between calls


Download ppt "1 CS 106, Winter 2009 Class 17, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,"

Similar presentations


Ads by Google