Welcome back to Software Development!

Slides:



Advertisements
Similar presentations
What type of data can a variable hold?
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 6 Horstmann Programs that make decisions: the IF command.
(c) 2003 E.S.Boese1 Conditionals Chapter 10 - Student.
Switch structure Switch structure selects one from several alternatives depending on the value of the controlling expression. The controlling expression.
Logical Operators Java provides two binary logical operators (&& and ||) that are used to combine boolean expressions. Java also provides one unary (!)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 4- 1.
Copyright © 2012 Pearson Education, Inc. Chapter 4: Making Decisions.
Flow control 1: if-statements (Liang 72-80) if(radius < 0) { System.out.println(“cannot get area: radius below zero”); } else { double area = radius *
Relational Operators Control structures Decisions using “if” statements  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course.
Section 3 - Selection and Repetition Constructs. Control Structures 1. Sequence 2. Selection 3. Repetition.
ROBOTC Software Introduction. ROBOTC Software ROBOTC developed specifically for classrooms and competitions Complete programming solution for VEX Cortex.
Copyright © 2012 Pearson Education, Inc. Chapter 4: Making Decisions.
Chapter 3:Decision Structures.  3.1 The if Statement  3.2 The if-else Statement  3.3 The if-else-if Statement  3.4 Nested if Statements  3.5 Logical.
PHP Conditional Statements Conditional statements in PHP are used to perform different actions based on different conditions. Conditional Statements Very.
Making Decisions. 4.1 Relational Operators Used to compare numbers to determine relative order Operators: > Greater than < Less than >= Greater than.
Fundamental Programming: Fundamental Programming Introduction to C++
CompSci 100E 2.1 Java Basics - Expressions  Literals  A literal is a constant value also called a self-defining term  Possibilities: o Object: null,
 Learn about control structures  Examine relational and logical operators  Explore how to form and evaluate logical (Boolean) expressions  Learn how.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Making Decisions.
Chapter 7 Selection Dept of Computer Engineering Khon Kaen University.
Applications Development
Week 8: Decisions Bryan Burlingame 21 October 2015.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 4: Making Decisions.
Lecture 2 Conditional Statement. chcslonline.org Conditional Statements in PHP Conditional Statements are used for decision making. Different actions.
Chapter Making Decisions 4. Relational Operators 4.1.
CHAPTER 5 MAKING DECISION Hidayah Elias BFC2042 – Computer Programming.
Basic Conditions. Challenge: ● Ask the user his/her name ● If it’s “Wally,” jeer him ● Pause video and try on your own.
Chapter 3 Decisions Three control structures Algorithms Pseudocode Flowcharts If…then …else Nested if statements Code blocks { } multi statement blocks.
1 CS 177 Week 6 Recitation Slides Review for Midterm Exam.
BOOLEAN OPERATIONS AND CONDITIONALS CHAPTER 20 1.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 4: Making Decisions 1.
 2003 Prentice Hall, Inc. All rights reserved. 1 Basic C++ Programming.
JAVA PROGRAMMING Control Flow. Jeroo: Finish Activities 1-7 Finish InputTest program w/changes.
C syntax (simplified) BNF. Program ::= [ ] Directives ::= [ ] ::= | |… ::=#include > ::=#define.
COMP 2710 Software Construction Flow of Control – switch and loops Programming Exercises Dr. Xiao Qin Auburn University
PHP using MySQL Database for Web Development (part II)
Discussion 4 eecs 183 Hannah Westra.
Chapter 1.2 Introduction to C++ Programming
Chapter 3 Selection Statements
Chapter 1.2 Introduction to C++ Programming
Chapter 1.2 Introduction to C++ Programming
Chapter 1.2 Introduction to C++ Programming
Week of 12/12/16 Test Review.
Chapter 4: Control Structures I
The switch Statement, and Introduction to Looping
Chapter 4: Making Decisions.
2.5 Another Java Application: Adding Integers
Chapter 4: Making Decisions.
Expressions and Control Flow in JavaScript
Chapter 4: Making Decisions.
Microsoft Visual Basic 2005 BASICS
Chapter 4: Control Structures I
Conditions and Ifs BIS1523 – Lecture 8.
Welcome back to Software Development!
C# Basics These slides are designed for Game Design Class
If Statements.
What is the name of your company? …by Monday…
Chapter 3: Selection Structures: Making Decisions
Boolean Expressions to Make Comparisons
Welcome back to Software Development!
Relational Operators.
Welcome back to Software Development!
Test Plans Making the world safe for software
Welcome back to Software Development!
Fundamental Programming
Clear and Unclear Windows
Chapter 3: Selection Structures: Making Decisions
Welcome back to Software Development!
Presentation transcript:

Welcome back to Software Development!

MiniAdventure Peer Review

MiniAdventure Peer Review I will tell you who to swap with

MiniAdventure Peer Review I will tell you who to swap with Use the rubric

MiniAdventure Peer Review I will tell you who to swap with Use the rubric Your names in the Reviewers section

MiniAdventure Peer Review I will tell you who to swap with Use the rubric Your names in the Reviewers section 5-10 minutes

The MiniAdventure – A Postmortem

The MiniAdventure – A Postmortem Take five minutes

The MiniAdventure – A Postmortem Take five minutes You will turn in (single sheet, names at top, project name at top)

The MiniAdventure – A Postmortem Take five minutes You will turn in (single sheet, names at top, project name at top) At least two things that went well (what worked?)

The MiniAdventure – A Postmortem Take five minutes You will turn in (single sheet, names at top, project name at top) At least two things that went well (what worked?) At least two things that didn’t work well (what didn’t work?)

The MiniAdventure – A Postmortem Take five minutes You will turn in (single sheet, names at top, project name at top) At least two things that went well (what worked?) At least two things that didn’t work well (what didn’t work?) Think about:

The MiniAdventure – A Postmortem Take five minutes You will turn in (single sheet, names at top, project name at top) At least two things that went well (what worked?) At least two things that didn’t work well (what didn’t work?) Think about: The process

The MiniAdventure – A Postmortem Take five minutes You will turn in (single sheet, names at top, project name at top) At least two things that went well (what worked?) At least two things that didn’t work well (what didn’t work?) Think about: The process How the team worked

The MiniAdventure – A Postmortem Take five minutes You will turn in (single sheet, names at top, project name at top) At least two things that went well (what worked?) At least two things that didn’t work well (what didn’t work?) Think about: The process How the team worked Are you satisfied with how your project turned out?

The MiniAdventure – A Postmortem Take five minutes You will turn in (single sheet, names at top, project name at top) At least two things that went well (what worked?) At least two things that didn’t work well (what didn’t work?) Think about: The process How the team worked Are you satisfied with how your project turned out? What would you like to change?

Decisions in your code

Decisions in your code How do you code a decision box from your flowchart?

Decisions in your code How do you code a decision box from your flowchart? Is <blah-blah> true? N Y

Decisions in your code How do you code a decision box from your flowchart? We use the “if/else” branching statement Is <blah-blah> true? N Y

The C# Programming Language Branching Looping Numeric Data Types if / else do / while bool switch / case / default while int / long break for float / double return foreach char / string try / catch / throw continue

The if/else branching statement

The if/else branching statement if ( <condition> )

The if/else branching statement if ( <condition> ) { <Yes branch steps> }

The if/else branching statement if ( <condition> ) { <Yes branch steps> } else

The if/else branching statement if ( <condition> ) { <Yes branch steps> } else <No branch steps>

The if/else branching statement if ( <condition> ) { <Yes branch steps> } else <No branch steps> if ( userName == “Korben Dallas multipass” )

The if/else branching statement if ( <condition> ) { <Yes branch steps> } else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); }

The if/else branching statement if ( <condition> ) { <Yes branch steps> } else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else

The if/else branching statement if ( <condition> ) { <Yes branch steps> } else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else Console.WriteLine(“LeeLoo will destroy you”);

The if/else branching statement if ( <condition> ) { <Yes branch steps> } else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else Console.WriteLine(“LeeLoo will destroy you”);

if/else if/else Is Condition 1 true? Y N 1st Yes action Is Condition 2 2ndYes action No action

if ( <1st condition> )

if ( <1st condition> ) { <1st Yes branch steps> }

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> )

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps>

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps>

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” )

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); }

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” )

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” ) Console.WriteLine(“LeeLoo will destroy you”);

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” ) Console.WriteLine(“LeeLoo will destroy you”); else

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” ) Console.WriteLine(“LeeLoo will destroy you”); else Console.WriteLine(“Be careful!” );

if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” ) Console.WriteLine(“LeeLoo will destroy you”); else Console.WriteLine(“Be careful!” );

NOTICE…NO SEMICOLON if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” ) Console.WriteLine(“LeeLoo will destroy you”); else Console.WriteLine(“Be careful!” );

NOTICE…NO SEMICOLON if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” ) Console.WriteLine(“LeeLoo will destroy you”); else Console.WriteLine(“Be careful!” );

NOTICE…NO SEMICOLON if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” ) Console.WriteLine(“LeeLoo will destroy you”); else Console.WriteLine(“Be careful!” );

NOTICE…NO SEMICOLON if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” ) Console.WriteLine(“LeeLoo will destroy you”); else Console.WriteLine(“Be careful!” );

NOTICE…NO SEMICOLON if ( <1st condition> ) { <1st Yes branch steps> } else if ( <2nd condition> ) < 2nd Yes branch steps> else <No branch steps> if ( userName == “Korben Dallas multipass” ) { Console.WriteLine(“LeeLoo loves you”); } else if ( userName == “Zorg” ) Console.WriteLine(“LeeLoo will destroy you”); else Console.WriteLine(“Be careful!” );

Assignment vrs Comparison

Assignment vrs Comparison String myStr;

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”;

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”; Assignment: 1 equal sign

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”; Assignment: 1 equal sign Means “take what’s on the right side & put it in what’s on the left side.”

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”; Assignment: 1 equal sign Means “take what’s on the right side & put it in what’s on the left side.” Right side: source

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”; Assignment: 1 equal sign Means “take what’s on the right side & put it in what’s on the left side.” Right side: source Left side: destination

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”; Assignment: 1 equal sign Means “take what’s on the right side & put it in what’s on the left side.” Right side: source Left side: destination

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”; Assignment: 1 equal sign Means “take what’s on the right side & put it in what’s on the left side.” Right side: source Left side: destination

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”; Assignment: 1 equal sign Means “take what’s on the right side & put it in what’s on the left side.” Right side: source Left side: destination if ( myStr == “Hi Mom!” )

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”; Assignment: 1 equal sign Means “take what’s on the right side & put it in what’s on the left side.” Right side: source Left side: destination if ( myStr == “Hi Mom!” ) Comparison: 2 equal signs

Assignment vrs Comparison String myStr; myStr = “Hi Mom!”; Assignment: 1 equal sign Means “take what’s on the right side & put it in what’s on the left side.” Right side: source Left side: destination if ( myStr == “Hi Mom!” ) Comparison: 2 equal signs Means: “true or false – is what’s on the right side the same as what’s on the left side?”

Your Turn

Your Turn In your teams, write a program that:

Your Turn In your teams, write a program that: Asks the user to enter a question

Your Turn In your teams, write a program that: Asks the user to enter a question Based on that input, prints a message specific to that input

Your Turn In your teams, write a program that: Asks the user to enter a question Based on that input, prints a message specific to that input You must support at least 3 different output messages

Your Turn In your teams, write a program that: IF you get stuck… Asks the user to enter a question Based on that input, prints a message specific to that input You must support at least 3 different output messages IF you get stuck…

Your Turn In your teams, write a program that: IF you get stuck… Asks the user to enter a question Based on that input, prints a message specific to that input You must support at least 3 different output messages IF you get stuck… You can use the HiBill program on page 48 as guidance

Your Turn In your teams, write a program that: IF you get stuck… Asks the user to enter a question Based on that input, prints a message specific to that input You must support at least 3 different output messages IF you get stuck… You can use the HiBill program on page 48 as guidance Be creative, have some fun with it

Your Turn In your teams, write a program that: IF you get stuck… Asks the user to enter a question Based on that input, prints a message specific to that input You must support at least 3 different output messages IF you get stuck… You can use the HiBill program on page 48 as guidance Be creative, have some fun with it You have the remainder of the period…

Clear and Unclear Windows