Using Visual Logic To Teach A First Course In

Download Report

Transcript Using Visual Logic To Teach A First Course In

USING VISUAL LOGIC TO TEACH A FIRST
COURSE IN PROGRAMMING LOGIC
JORGE VALLEJOS – ASSISTANT PROFESSOR
([email protected])
COMPUTER SCIENCE DEPARTMENT
C O LU M B U S STAT E C O M M U N IT Y C O LLE G E
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
LOGIC – AND BENEFITS TO OUR STUDENTS
•
What Is Logic? – Loose Definitions
• The application of principles of correct reasoning
• Proper thinking about the understanding of something
• Interrelation of facts and events to reach valid conclusions
•
Why Is Logic Necessary?
• Solve complex tasks by applying systematic reasoning
• Establish an approach to understand, analyze and solve a problem
• Discover simple and efficient solutions to implement processes and systems
•
What Do Students Gain By Learning Logic?
• Develop skills for critical thinking
• Gather relevant facts, analyze them, and derive conclusions to troubleshoot systems
• Apply problem solving strategies – formalize theories, discard invalid assumptions,
establish priorities (ordering of actions and validation), solve problem in incremental
steps, isolate/reproduce issues, test solutions
• Readiness for programming courses and other analytical courses
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
2
COURSES THAT SUPPORT PROGRAMMING
LOGIC
•
MATH courses – beyond the algorithms and formulas, MATH creates the
foundation to discover relations between entities, combine building blocks to
compose new entities, build sets of detailed instructions to complete a task
•
READING/WRITING courses focused on comprehension – analyze complex
materials, apply critical analysis to reach conclusions, inductions and deductions
•
PHYLOSOPHY courses: cover topics like: critical thinking, methods of inductive,
deductive and symbolic logic
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
3
TOOLS FOR A FIRST COURSE IN PROGRAMMING
LOGIC
•
Visual Logic
• Creates visual/runnable representation of algorithms in flowchart format. The
program does not use formal programming-language instructions – like Java,
C#, or other programming languages
•
Alice/Alice3
• Creates 3D animations. Tool is oriented towards learning computer
programming. Drag objects from a palette onto a scene canvas. Objects are
constructed from Java classes. Methods are presented as menus – to control
the actions performed by objects
•
Scratch
• Creates animated objects. The program provides a list of instructions to control
the actions performed by objects
•
Other Tools – Search the Internet
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
4
VISUAL LOGIC FEATURES
•
Variables: store non-typed numeric and string constants
• There is no variable declaration – variables are created at the point of use
• Variable Scope: Global, Local
•
Constructs:
• Operators
• Arithmetic (+, -, *, /, Mod, ^), Comparison (<, >, …), Compound (AND, OR, …)
• Assignment (=)
• Sequences
• Conditions: if-then-else
• Loops
• while, do-while, for – Control of execution can be modified with the exit, continue
clauses
• Arrays
•
Procedures (a.k.a., modules) – named set of instructions:
• Parameters: passed by value, passed by reference
• Do not return a value
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
5
VISUAL LOGIC FEATURES - CONTINUED
•
Functions
• FormatCurrency(), FormatPercent(), Round(), Random(), …
• There is no Wait()/Sleep()-equivalent function.
• Alternative: to temporarily suspend the execution of instructions, create a
busy-do-nothing loop – keeping the CPU busy for a while
•
Input/Output
• Dialog boxes, Console, File
•
Enforces Structured Programming – There is no GOTO instruction
• All programming structures have a single entry/exit point
• It is not possible to create spaghetti code
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
6
VISUAL LOGIC PITFALLS
•
•
Variables are created at the point of use. Visual Logic creates a new variable for a
misspelled variable identifier
• Example:
• firstName – Correctly spelled variable identifier
• fisrtName – Misspelled variable identifier. Visual Logic creates the new variable
identifier with a default value zero (0)
Visual Logic does not enforce data types – (justification: students learn logic better
when focusing on the concepts – rather than syntax)
• It is possible to create invalid Boolean expressions in comparison/loop statements:
• while (YES <> number) { … }
• where YES stores the string constant “y”, and number stores a numeric
constant
• The Boolean expression evaluates as false – no syntax error, the loop-body
does not execute
• A variable initially assigned a string value can be assigned a numeric value in a
subsequent instruction
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
7
VISUAL LOGIC DEMONSTRATIONS
•
Sequences
•
Decisions
•
Loops
•
Arrays
•
Parameterized Procedures
•
Graphics
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
8
CONCLUSIONS/EXPERIENCES
•
The CSCC Computer Science Department has been using Visual Logic for the last
three years.
• The program has been favorably received by CSCC students, and transfer
students from other colleges/universities
• The student can verify the logic of her/his algorithm – the outputs generated
by the program can be compared against a set of expected outputs
• Programs can be easily created – by combining the Visual Logic instruction
shapes
•
Visual Logic is used in a basic programming logic course – taken by Computer
Science students pursuing different degrees (not just future programmers)
• The program is used to implement:
• Arithmetic algorithms
• Simulation of events – e.g., execute logically organized activities when
troubleshooting failures in hardware/software
• Basic graphical animations
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
9
CONCLUSIONS/EXPERIENCES - CONTINUED
•
Instructors must demonstrate how to avoid the Visual Logic pitfalls
• Create examples to eliminate logic/(syntax) faults caused by the Visual Logic
non-typed variables
• Demonstrate the Visual Logic debugging capabilities
• Create breakpoints, step into, step over, pause, run, …
• List the variables defined within the scope of procedures – find misspelled
variables, local variables obscuring global variables
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
10
REFERENCES
•
Visual Logic
• http://www.visuallogic.org/ – download the Visual Logic executable program
• Each student must buy a Visual Logic access code – gives right to use the
executable program
• Companion book: A Guide to Working with Visual Logic. Thad Crews & Chip
Murphy. Course Technology – Cengage Learning. ISBN 978-0-324-60119-0
•
Alice
• http://www.alice.org/index.php
•
Scratch
• http://www.scratch.mit.edu
OHIO EDUCATIONAL TECHNOLOGY CONFERENCE - JANUARY
2014
11