Programming Fundamentals Lec 1
Programming Fundamentals Lec 1
Fundamentals
Comp 102 F
(T R 15:30 - 16:45) (Lab T 8:00-10:50)
Office: S426-A
Learning Objectives
Answer:
• Very high processing speed
• Huge memory
• High accuracy
• Doesn’t get tired
Computers have
limitations
• Commands Available:
forward()
move forward 1 step
• Goal:
Get the cup
• Solution:
• 1 forward()
• 2 forward()
• 3 forward()
• Commands Available:
forward()
move forward 1 step
left()
turn left 90ᵒ
• Solution:
• 1 forward()
• 2 forward()
• 3 forward()
• 4 left()
• 5 forward()
• 6 forward()
• Commands Available:
forward() ×1
repeat n: ×1
repeats commands n
times
• Solution:
1 repeat 5:
2 forward()
Repeat
comma
nd
Syntax
You Try:
• Commands Available:
forward() ×2
left() ×1
repeat n: ×2
Summary
Summary
• Programming is giving instructions to a computer to
perform tasks.
• Computers are stupid and not creative.
• Programmatic thinking is breaking down a problem into
smaller steps.
• Commands are used to instruct the computer.
Don’t forget the Homework!