0% found this document useful (0 votes)
53 views

Programming: Sanit Sirisawatvatana

Programming involves solving problems through automating processes and creating software. It allows tasks to be done more easily, quickly and with less effort. Programming requires identifying and analyzing problems before developing and implementing a plan to solve the problem and evaluate the results. Key skills for programming include knowledge of programming languages, algorithms, and software engineering principles. Popular programming languages include Java, Python, C++ and JavaScript. Learning programming involves understanding concepts like variables, conditionals, loops, arrays, objects and classes. The programming process is iterative and involves coding solutions, debugging errors, and improving the program.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Programming: Sanit Sirisawatvatana

Programming involves solving problems through automating processes and creating software. It allows tasks to be done more easily, quickly and with less effort. Programming requires identifying and analyzing problems before developing and implementing a plan to solve the problem and evaluate the results. Key skills for programming include knowledge of programming languages, algorithms, and software engineering principles. Popular programming languages include Java, Python, C++ and JavaScript. Learning programming involves understanding concepts like variables, conditionals, loops, arrays, objects and classes. The programming process is iterative and involves coding solutions, debugging errors, and improving the program.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Programming

Sanit Sirisawatvatana
What is programming ?
Solve problems
Easier tasks
Less processes
Fast performance
automation
Create creativity
New ideas
What are benefits?
For programmers
Think systematically/logically (well organized)
Apply to similar problems
Earn money from selling their software
Test conceptual ideas
Steps for programming
Identify
the problem
Analyze
the problem
Develop
a plan
Implement
the plan
Evaluate
the result
http://blog.careerfutura.com/brain-exercises-to-improve-creativity-and-problem-solving/
http://www.metaquest.nl
How it works?
What skills are required ?
Language syntax
Good memory
Application framework
Specialized and technical knowledge
Algorithms
Software engineering principles
Programming languages
Machine codes
Assembly
Basic
Pascal
C/C++/C#
Smalltalk
Visual Basic
Java
Python
Dot Net
PHP/Ruby/Perl
JavaScript
PL/SQL
Contents of learning in
programming
Data types
Variables
Conditional statements
Loop statements
Error handling
Subprograms
Arrays
Object-oriented (OO)
Graphic User Interface (GUI)
Built-in libraries
Java Programming Path
Awt
Swing
JavaBeans
Layout
managers
Menus
Toolbars
MVC
2D/3D
event-driven
JavaFX
Animations
Multimedia
Multithreading
Parallel
programming
Networking
Database
Servlets
Java Server
Page (JSP)
Java Server
Faces
Web Service
Remote Method
Invocations
Lists, Stacks,
Queues
Sets, Maps,
Sorting
Binary search
trees
Hashing
Graphs
Objects/Classes
Inheritance
Polymorphism
Exception
handling
Text I/O
Binary I/O
Abstract Class
Interfaces
Basic statements
Selections
Loops
Arrays
Subprograms
(Methods)
Programming cycle
Solving Tower of Hanoi problem
Problem:
Move disks to another
pole
Rules
No disk can not put
on top of a smaller
disk
Move only one disk
at a time
Game : Tic-Tac-Toe(OX)
To win a game
Player who
succeeds in placing
continuous marks in
a horizontal, vertical
or diagonal row.
Rules
Two players (O or X)
who take turns
marking the space
in a nxn grid.
Analyze the problem
Find the location of mouse to determine the
block number.
If you press or click the mouse, check whether
the block is empty or not.
If the block is empty, mark the letter O or X
Check whether there are three continuous
marks or not.
If yes, draw a line through the thee
continuous marks, alert that the player wins
the game and finish the game.
Change a turn to another player
Flowchart
Coding
void setup(){
size(800,800) ;
initialize_blocks() ;
set_turn(X) ;
}
void draw(){
draw_blocks() ;
select_blocks() ;
check_block() ;
if ( is_three_blocks() ){
alert(You are winner!) ;
exit_game() ;
}
change_turn() ;
}
Problems in learning
programming
How to write a program
Know and understand syntaxes
Start small and build in increments
Look a the sample code
How to solve/fix errors
Guess the cause of errors and test the
assumption
Debug step by step
Search error from Internet
5 ways to learn
programming faster
Look at the example code
Dont just read example codeRun it
Write your own code as soon as possible
Learn to use a debugger
Seek out more sources
http://www.cprogramming.com/how_to_learn_to_program.html
Best practices for writing a
program
Use naming conversion
Declare and initialize variables before
using
Write code in small modules
Write comments for modules and
variables
Write exception handling
Use debugger to trace a program
8 common programing
mistakes
1. Undeclared variables
2. Uninitialized variables
3. Setting a variable to an uninitialized value
4. Using a single equal to check equality
5. Undeclared functions
6. Extra semicolons
7. Overstepping array boundaries
8. Misusing the && and || operators
****Infinite loops/looping process
http://www.cprogramming.com/tutorial/common.html
Q & A

You might also like