Download presentation
Presentation is loading. Please wait.
Published byJared Jacobs Modified over 9 years ago
2
Algorithms A sequence of instructions 1. Preheat oven to 350 degrees F (175 degrees C). Grease and flour a 9x9 inch pan or line a muffin pan with paper liners. 2. In a medium bowl, cream together the sugar and butter. Beat in the eggs, one at a time, then stir in the vanilla. 3.Combine flour and baking powder, add to the creamed mixture and mix well. Finally stir in the milk until batter is smooth. Pour or spoon batter into the prepared pan. 4. Bake for 30 to 40 minutes in the preheated oven. Cake is done when it springs back to the touch.
3
Computers are dumb
4
Language Hint: its not English
5
Jython Python in Java
6
Lesson 1: “Hello World!” print “Hello World”
7
Lesson 2: Data Types Integer 4,-2,100 Float 4.878, 2.0 String “Hello!123#$”
8
Lesson 3: Variables Store data Jython gets it! X= “Hi” X = 5.67 X= 2
9
Quick Test print 33 print “Hello” + “ “ + “World” + “!” print 22+3 print “22” + “3” print “22” + 3 print “22” * 3 print 5/3 x = 5 print x*3
10
JES
11
How to start def function(): print “Hello World” def otherFunction(): print “Hello World Again!” Indentation groups statements together
12
And then… Save then LOAD!! Call your function
13
Class Exercise 1. Define a function(using the def keyword) called Lab1Program 2. Create a variable called name and place in it your name, e.g. name = “Maha” 3. Print out the statement: “My name is “ + name 4. Create a new variable called myNum, place the value 5.5 in it 5. Calculate the value of myNum*4, place the answer in the variable myNum 6. Print out myNum+3
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.