Lecture-11(intro to programing-logic-cammands)

Lecture-11(intro to programing-logic-cammands) - Basics of...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Basics of Computer Programming Lecture - 11
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What is a program? A program consists of a set of instructions that the computer implements one after the other Similar to a set of instructions given to someone for cooking e.g. Boil water Put noodles in water and let cook Stir fry with vegetables and spice
Background image of page 2
Instruction set Basic Instruction set Boil water Put noodles in water and let cook Stir fry with vegetables and spice Variations are possible, but the results may not be consistent (or desirable) Boil water Pour hot water on noodles, vegetables and spice Stir fry the entire mix Yucky, gooey mess
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Instruction set Basic instruction set Sub Sine() angle = 30 pi = 22 / 7 x = asin (angle/pi) End Sub Variation Sub Sine() angle = 30 x = asin (angle/pi) pi = 22 / 7 End Sub pi is not defined when x was calculated. The default value of pi = 0 is used for calculating x and since division by zero is not defined, that will result in a error
Background image of page 4
Concept of Assignment In the previous example:
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/27/2008 for the course PGE 310f taught by Professor Srinivasan during the Spring '08 term at University of Texas at Austin.

Page1 / 12

Lecture-11(intro to programing-logic-cammands) - Basics of...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online