Elika in High School Elika in College Elika
- Slides: 54
Eliška in High School
Eliška in College
Eliška teaching
Ondra
Control Statements for(int i = 0; i < N; i++) { // to repeat N times } while(condition) { // repeat while condition holds } if(condition) { // todo if true } else { // todo if false }
Readable code public void run() { while (beepers. In. Bag()) { find. Tree(); add. Leaves. To. Tree(); } move. To. Wall(); } private void add. Leaves. To. Tree() { turn. Left(); climb. Tree(); add. Leaves(); descend. To. Ground(); turn. Left(); private void find. Tree() { move. To. Wall(); }
Readable code public void run() { while (beepers. In. Bag()) { find. Tree(); add. Leaves. To. Tree(); } move. To. Wall(); } private void add. Leaves. To. Tree() { turn. Left(); climb. Tree(); add. Leaves(); descend. To. Ground(); turn. Left(); private void find. Tree() { move. To. Wall(); }
Readable code public void run() { while (beepers. In. Bag()) { find. Tree(); add. Leaves. To. Tree(); } move. To. Wall(); } private void add. Leaves. To. Tree() { turn. Left(); climb. Tree(); add. Leaves(); descend. To. Ground(); turn. Left(); private void find. Tree() { move. To. Wall(); }
Readable code public void run() { while (beepers. In. Bag()) { find. Tree(); add. Leaves. To. Tree(); } move. To. Wall(); } private void add. Leaves. To. Tree() { turn. Left(); climb. Tree(); add. Leaves(); descend. To. Ground(); turn. Left(); } private void find. Tree() { move. To. Wall(); }
Readable code public void run() { while (beepers. In. Bag()) { find. Tree(); add. Leaves. To. Tree(); } move. To. Wall(); } private void add. Leaves. To. Tree() { turn. Left(); climb. Tree(); add. Leaves(); descend. To. Ground(); turn. Left(); } private void find. Tree() { move. To. Wall(); }
Readable code public void run() { while (beepers. In. Bag()) { find. Tree(); add. Leaves. To. Tree(); } move. To. Wall(); } private void add. Leaves. To. Tree() { turn. Left(); climb. Tree(); add. Leaves(); descend. To. Ground(); turn. Left(); } private void find. Tree() { move. To. Wall(); }
Readable code public void run() { while (beepers. In. Bag()) { find. Tree(); add. Leaves. To. Tree(); } move. To. Wall(); } private void add. Leaves. To. Tree() { turn. Left(); climb. Tree(); add. Leaves(); descend. To. Ground(); turn. Left(); } private void find. Tree() { move. To. Wall(); }
Readable code public void run() { while (beepers. In. Bag()) { find. Tree(); add. Leaves. To. Tree(); } move. To. Wall(); } private void add. Leaves. To. Tree() { turn. Left(); climb. Tree(); add. Leaves(); descend. To. Ground(); turn. Left(); } private void find. Tree() { move. To. Wall(); }
Readable code public void run() { while (beepers. In. Bag()) { find. Tree(); add. Leaves. To. Tree(); } move. To. Wall(); } private void add. Leaves. To. Tree() { turn. Left(); climb. Tree(); add. Leaves(); descend. To. Ground(); turn. Left(); } private void find. Tree() { move. To. Wall(); }
Decomposition
Decomposition public void run() { move(); turn. Left(); move(); pick. Beeper(); turn. Left(); move(); turn. Left(); move(); }
Decomposition Collect Newspaper = Exit House then Pick. Up. Paper then Return. Home
Decomposition public void run() { exit. House(); pick. Up. Paper() ; return. Home(); } private void exit. House() { move(); turn. Right(); move(); turn. Left(); move(); } private void pick. Up. Paper() { pick. Beeper(); } private void return. Home() { turn. Around(); move(); turn. Right(); move(); }
Method names private void best. Method. Ever() {. . . } private void best. Method. Ever. Better() {. . . }
Method names private void turn. Right() {. . . } private void build. Column() {. . . }
See You Later! I will miss you. Enjoy Java! Call me maybe?
Java
Our TO DO list How to write a console program? What are variables? How to get user input in a console program? How to use variables?
Console Program Do you like trains? Yes
Hello World import acm. program. *; public class Hello. Program extends Console. Program { public void run() { println("Hello world!"); } } Hello. Console Hello world!
Our TO DO list How to write a console program? What are variables? How to get user input in a console program? How to use variables?
What is a variable?
Variables in maths 2 x + 3 x - 4 y = 0
Variables in computer science
Declaring a variable
Declaring a variable - TYPE int
Declaring a variable - NAME int counter c n u o r e t
Declaring a variable - VALUE int counter = 42; 42 c n u o r e t
Variable types 42. 38 ‘a’ 42 true “ ” o l hel
Variable types in Java String str = “Hi”; int num = 5; double fraction = 0. 2; boolean cond = false; char cond = ‘X’;
How heavy are you?
How Many Children Do I Have?
Our TO DO list How to write a console program? What are variables? How to get user input in a console program? How to use variables?
User Input int children = read. Int(“message”); double weight = read. Double(“message”); String name = read. Line(“message”);
Our TO DO list How to write a console program? What are variables? How to get user input in a console program? How to use variables?
Binary Operators + Addition – Subtraction * Multiplication / Division % Remainde r
PROGRAMMI NG
What do you think this does? import acm. program. *; public class Hello. Program extends Console. Program { public void run() { println(1/2); } }
Resulting Type int / int = int double / double = double int / double = double
PROGRAMMI NG
Comparison Operators < Less Than > Greater Than <= Less or Equal >= More or Equal == Equal To != Not Equal To
PROGRAMMI NG
Our TO DO list How to write a console program? What are variables? How to get user input in a console program? How to use variables?
Your job: Play with variables!
- Early college high school at midland college
- Elika horažďovice
- Elika mahdavi
- T-stem early college high school
- El valle verde
- Queens high school for the sciences at york college ranking
- Itineris early college high school
- Flora's first day at school question answer
- Mission early college high school logo
- High school gpa as predictor of college success
- Infinite campus perth amboy
- Northwest early college high school
- Turner college and career high school
- Bard high school early college west
- Azad bakht high school
- Crescenta valley high school summer school
- Assignment in spanish
- Wake tech admissions
- High precision vs high recall
- High precision vs high recall
- Directive behavior
- High expectations high support
- Significant figures
- High directive and low supportive behavior
- High risk high return artinya
- Nurul alam school and college
- Berry college school colors
- Ahmed bawany academy school & college
- James weldon johnson middle
- Specialist maths school
- Fairfield college preparatory school
- Dublin business school
- Christina ioannides
- Sylhet technical school and college
- Probortok school and college
- Baylor college of medicine academy at ryan middle school
- Xxx school com.
- Chemistry parody videos
- Nackawic high school powerschool
- Windermere high school guidance counselors
- Whrhs.org
- Waukee high school transcript request
- Unionville high school open house
- Tucson high magnet school
- Pope hs band
- The glen high school moodle
- Jacketeer
- Steinmetz uniform
- St. robert catholic high school
- Ramstein high school
- Rio americano sports
- Interlake high school counselors
- Interlake course catalog
- Prairie view high school basketball
- Pierre elliott trudeau high school courses