 What does “The Play Button” do?  “javac.exe YourClass.java”  Compilation  “java YourClass”  Execution on the Java Virtual Machine  Input & Output.

Slides:



Advertisements
Similar presentations
Control Structures.
Advertisements

AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Chapter 4 Decision Making Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E. Reingold.
Switch code for Lab 4.2 switch (input) { /* input is a variable that we will test. */ case 'M': printf("The prefix is equal to 1E6.\n"); break; case 'k':
L2:CSC © Dr. Basheer M. Nasef Lecture #2 By Dr. Basheer M. Nasef.
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Fundamental Programming Structures in Java: Control Flow, Arrays and Vectors.
3. S/E with Control Structures 3.1 Relational Operators and Expressions 3.2 If and if-else Statements 3.3 The Type Double 3.4 Program Design with the While.
July 13 th.  If/ Else if / Else  Variable Scope  Nested if/else's  Switch statements  Conditional Operator.
 Instructor Rob Nash  Final this Wednesday.  See the message board topic lists.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie July 5, 2005.
Introduction to Computers and Programming Lecture 10: For Loops Professor: Evan Korth New York University.
Introduction to Computers and Programming Lecture 10: For Loops Professor: Evan Korth New York University.
IC211 Lecture 8 I/O: Command Line And JOptionPane.
COMP 14 Introduction to Programming Miguel A. Otaduy May 20, 2004.
Relational Operators Control structures Decisions using “if” statements  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course.
COMP 110 Introduction to Programming Mr. Joshua Stough September 24, 2007.
Control Structures II. Why is Repetition Needed? There are many situations in which the same statements need to be executed several times. Example: Formulas.
Chapter 4: Control Structures II
Agenda Review User input Scanner Strong type checking Other flow-control structures switch break & continue Strings Arrays 2.
1. a) What is Program design? Describe the program development cycle? b) What is Flow Chart? Explain the different symbols available in Flowchart? 2.
1 CSC 201: Computer Programming I B. S. Afolabi. Introduction  3 unit course  2 hours of lecture/week Thursdays 4.00pm – 6.00pm Mondays 4.00pm – 6.00pm.
Programming Fundamentals. Today’s lecture Decisions If else …… Switch Conditional Operators Logical Operators.
Java Programming: From Problem Analysis to Program Design, Second Edition1 Lecture 4 Objectives  Learn about repetition (looping) control structures.
CS 101E – Exam 2 Review Spring 2007 Michele Co. Announcements Review Session Tonight, 7/7:30 p.m., OLS 009 Will be announced via In-class Exam Wednesday.
Programming in Java Unit 4. Learning outcome:  LO2: Be able to design Java solutions  LO3: Be able to implement Java solutions Assessment criteria:
October 28, 2015ICS102: For Loop1 The for-loop and Nested loops.
Lecture 3 Decisions (Conditionals). One of the essential features of computer programs is their ability to make decisions. Like a train that changes tracks.
Group 4 Java Compiler Group Members: Atul Singh(Y6127) Manish Agrawal(Y6241) Mayank Sachan(Y6253) Sudeept Sinha(Y6483)
COMP 110 switch statements and while loops Luv Kohli September 10, 2008 MWF 2-2:50 pm Sitterson
Introduction to Java Java Translation Program Structure
Repetition. Control of Flow SEQUENCE SELECTION (if..else, switch…case) REPETITION.
Java Basics Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Chapter 4 Control Structures I. Chapter Objectives Learn about control structures Examine relational and logical operators Explore how to form and evaluate.
Final Jeopardy Fundamen tal Java Numerical Data type Boolean Expressi on If/THEN/ WHILE Miscellan eous
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
CONTROL STATEMENTS LOOPS. WHY IS REPETITION NEEDED?  There are many situations in which the same statements need to be executed several times.  Example:
1 Chapter 3: Loops and Logic. 2 Control Statements If statement Example NumberCheck.java Relational operators (, >=, ==, !=) Using code blocks with If.
By Mr. Muhammad Pervez Akhtar
CST336, Dr. Krzysztof Pietroszek Week 2: PHP. 1.Introduction to PHP 2.Embed PHP code into an HTML web page 3.Generate (output HTML) web page using PHP.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Lecture 15: Course Review BJ Furman ME 30 16MAY2011.
CONTROL STRUCTURE Chapter 3. CONTROL STRUCTURES ONE-WAY SELECTION Syntax: if (expression) statement Expression referred to as decision maker. Statement.
Chapter 2: Fundamental Programming Structures in Java Adapted from MIT AITI Slides Control Structures.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 5 Control Structures II: Repetition.
CS1010: Programming Methodology
JAVA PROGRAMMING Control Flow. Jeroo: Finish Activities 1-7 Finish InputTest program w/changes.
Chapter 7 Control Structures. Java has very flexible three looping mechanisms. You can use one of the following three loops:  while Loop  do...while.
Introduction to Computers and Programming Lecture 10: For Loops Professor: Evan Korth New York University.
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
CS1010 Discussion Group 11 Week 5 – Functions, Selection, Repetition.
Java Fundamentals 4.
Chapter 5: Control Structures II
Unit-1 Introduction to Java
Chapter 5: Control Structures II
Chapter 5: Control Structures II
CS 1428 Exam I Review.
CiS 260: App Dev I Chapter 4: Control Structures II.
Repetition-Sentinel,Flag Loop/Do_While
Expressions and Control Flow in JavaScript
Chapter 5: Control Structures II
Homework Any Questions?.
Program Flow.
Chapter 4: Boolean Expressions, Making Decisions, and Disk Input and Output Prof. Salim Arfaoui.
Michele Weigle - COMP 14 - Spr 04 Catie Welsh February 14, 2011
Chapter 3 Debugging Section 3.4
Decision Structures if, if/else conditions
CSS161: Fundamentals of Computing
CS 1428 Exam I Review.
Presentation transcript:

 What does “The Play Button” do?  “javac.exe YourClass.java”  Compilation  “java YourClass”  Execution on the Java Virtual Machine  Input & Output  To and from the console  JOptionPane?

 Strings & String operations  Concatenation, charAt, substring

 Scanner Input (console input  println() Output  Import statements

 Boolean expressions (<,<=, !=, ==, …)  Boolean variables  If “tests”  Loop “tests”  AND, OR, and NOT  Know the truth tables  Given p and q

 Single IFs  If( test ) {  }  IF/ELSE  If(test) {  } else {  }  Chained IF/ELSE  If(test1) {  } else if {  } else {  }

 Decision Statements (Selection Control Structures)  Switch statements  Loops (Repetition Control Structures)  For  While  Do/While

 Break and Continue  “==“ versus “=“ versus “.equals( “foo” )”  “Tracing variables” (is debugging)  Variable Scope  Local and Class wide

 Sum the first 10 numbers  Produce an average given 12 numbers  Draw a box of stars  Draw a triangle of stars

??

 Closed book/notes, short questions  3-5 big questions  3-5 medium questions  3-5 small questions

 Write a few lines of code that does Y  Write a function that X  Write a main that does z  What does the following code do?  What does it output?  Tracing code  What is the result of the following line(s) of code?

 Labs!  HWs!  Lectures & In Class Demos  Savitch

 File IO  Try/Catch  printf