Fundamentals of Software Development ISlide 1 Recap: Key ideas in WordGames ClassClass –versus instances –Defining –use of fields –Constructors E.g., to.

Slides:



Advertisements
Similar presentations
PHP functions What are Functions? A function structure:
Advertisements

Fundamentals of Software Development 1Slide 1 Recap: Constructors, the new operator and the this object Three ideas:Three ideas: –How to write a constructor.
Local Variables and Scope Benjamin Fein. Variable Scope A variable’s scope consists of all code blocks in which it is visible. A variable is considered.
Written by: Dr. JJ Shepherd
Fundamentals of Software Development 1Slide 1 Review: Why start with WordGames? You wrote your first lines of code in this course in WordGames.You wrote.
1 Composition A whole-part relationship (e.g. Dog-Tail) Whole and part objects have same lifetime –Whole creates instance of part in its constructor In.
ITC 240: Web Application Programming
Branching Constructs Review l what are branching constructs? what type of branching constructs have we studied? l what is nested if? l what is multiway.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Fundamentals of Software Development ISlide 1 Recap: Key ideas in WordGames ClassClass –versus instances –Defining –use of fields –Constructors E.g., to.
Repetition Statements repeat block of code until a condition is satisfied also called loops Java supports 3 kinds of loops: while statement – repeats a.
Object Oriented Software Development
Programming Languages and Paradigms Object-Oriented Programming.
Fundamentals of Software Development 1Slide 1 Recap: Key ideas in WordGames Defining a classDefining a class Extending a class versus implementing an interfaceExtending.
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.
Java ProgrammingtMyn1 Java Programming Timo Mynttinen Mikkeli University of Applied Sciences.
Fundamentals of Software Development 1Slide 1 Loops A loop is:A loop is: –a block of code that executes repeatedly while some condition holds true. Java.
1 Introduction Modules  Most computer programs solve much larger problem than the examples in last sessions.  The problem is more manageable and easy.
Inheritance in the Java programming language J. W. Rider.
Session 08 Module 14: Generics and Iterator Module 15: Anonymous & partial class & Nullable type.
PHP Conditional Statements Conditional statements in PHP are used to perform different actions based on different conditions. Conditional Statements Very.
F27SA1 Software Development 1 3. Java Programming 2 Greg Michaelson.
COMPUTER PROGRAMMING. Iteration structures (loops) There may be a situation when you need to execute a block of code several number of times. In general,
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Advanced Computer Science Lesson 4: Reviewing Loops and Arrays Reading User Input.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Fundamentals of Software Development ISlide 1 Recap: Key ideas in WordGames Defining a classDefining a class Extending a class versus implementing an interfaceExtending.
C++ / G4MICE Course Session 2 Basic C++ types. Control and Looping Functions in C Function/method signatures and scope.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
02/14/2005 Introduction to Programming with Java, for Beginners Midterm 1 Review.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
1 Java Review Outline Java Primitives, Program Structure Operators, Control Flow, Loops Classes and Objects Arrays and ArrayList Files Most of these slides.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Fundamentals of Software Development 1Slide 1 Loops A loop is:A loop is: –a block of code that executes repeatedly while some condition holds true. Java.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Written by: Dr. JJ Shepherd
A High Flying Overview CS139 – Fall 2006 How far we have come.
Java & C++ Comparisons How important are classes and objects?? What mechanisms exist for input and output?? Are references and pointers the same thing??
 Static  Example for Static Field  Example for Static Method  Math class methods  Casting  Scope of Declaration  Method Overloading  Constructor.
AP Java Ch. 4 Review Question 1  Java methods can return only primitive types (int, double, boolean, etc).
Class Everything in Java is in a class. The class has a constructor that creates the object. If you do not supply a constructor Java will create a default.
C# Fundamentals An Introduction. Before we begin How to get started writing C# – Quick tour of the dev. Environment – The current C# version is 5.0 –
Creating Java Applications (Software Development Life Cycle) 1. specify the problem requirements - clarify 2. analyze the problem - Input? Processes? Output.
Loops, Methods, Classes Using Loops, Defining and Using Methods, Using API Classes, Exceptions, Defining Classes Svetlin Nakov Technical Trainer
01/05/100 1 Loops/Iteration Used to repeat an action Must have a STOP condition Three flavors - for, while, do/while.
Inheritance a subclass extends the functionality of a superclass a subclass inherits all the functionality of a superclass don't reinvent the wheel – "stand.
Review for Test2. Scope 8 problems, 60 points. 1 Bonus problem (5 points) Coverage: – Test 1 coverage – Exception Handling, Switch Statement – Array of.
Recap: Key ideas in WordGames
Loops A loop is: Java provides three forms for explicit loops:
Objects as a programming concept
Loops in Java.
Section 11.1 Class Variables and Methods
Memberwise Assignment / Initialization
Using local variable without initialization is an error.
For Loops October 12, 2017.
Final Review Dr. Xiaolin Hu.
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Unit 6 - Variables - Fundamental Data Types
Final Review Fan Bai Csc 2310 Spring 2012.
© A+ Computer Science - Classes And Objects © A+ Computer Science -
Which best describes the relationship between classes and objects?
Week 4 Lecture-2 Chapter 6 (Methods).
A LESSON IN LOOPING What is a loop?
Software Engineering Lecture #29
PROGRAM FLOWCHART Iteration Statements.
Review for Midterm 3.
Corresponds with Chapter 5
Threads and concurrency / Safety
Presentation transcript:

Fundamentals of Software Development ISlide 1 Recap: Key ideas in WordGames ClassClass –versus instances –Defining –use of fields –Constructors E.g., to initialize fieldsE.g., to initialize fields Extending a class versus implementing an interfaceExtending a class versus implementing an interface Methods, parameters and local variablesMethods, parameters and local variables We reviewed almost all of these ideas in Session 11! Blocks and scopeBlocks and scope Declaring variablesDeclaring variables ExpressionsExpressions StatementsStatements –Assignment –Conditionals –Blocks –Loops (now) Except for this one …

Fundamentals of Software Development ISlide 2 Loops A loop is: a block of code that executes repeatedly while some condition holds true.a block of code that executes repeatedly while some condition holds true. while (condition) { statement; … statement; } for (start; condition; step) { statement; … statement; } do { statement; … statement; } while (condition); while loop for loop do-while loop

Fundamentals of Software Development ISlide 3 Loops solve a problem How to write code to do things which we want to repeat! … like:How to write code to do things which we want to repeat! … like: Scanner inputStream = new Scanner(System.in); double input; input = inputStream.nextDouble(); while (input >= 0) { System.out.println(input*input); input = inputStream.nextDouble(); } Question: Could you do this one without loops? Depends on the type of variable you want to read!