CIS 199 Test 02 Review.

Slides:



Advertisements
Similar presentations
CS0007: Introduction to Computer Programming
Advertisements

1 Chapter Five Selection and Repetition. 2 Objectives How to make decisions using the if statement How to make decisions using the if-else statement How.
Introduction to Programming Lesson 1. Objectives Skills/ConceptsMTA Exam Objectives Understanding Computer Programming Understand computer storage and.
5/17/ Programming Constructs... There are several types of programming constructs in JAVA. - If-else construct or ternary operator - while - do-while.
July 13 th.  If/ Else if / Else  Variable Scope  Nested if/else's  Switch statements  Conditional Operator.
C Lecture Notes 1 Program Control (Cont...). C Lecture Notes 2 4.8The do / while Repetition Structure The do / while repetition structure –Similar to.
Chapter 6: User-Defined Functions I Instructor: Mohammad Mojaddam
CIS 199 Test 01 Review. Computer Hardware  Central Processing Unit (CPU)  Brains  Operations performed here  Main Memory (RAM)  Scratchpad  Work.
Control Structures Session 03 Mata kuliah: M0874 – Programming II Tahun: 2010.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
CPS120: Introduction to Computer Science Decision Making in Programs.
Current Assignments Homework 2 is available and is due in three days (June 19th). Project 1 due in 6 days (June 23 rd ) Write a binomial root solver using.
Chapter 7 Additional Control Structures. 2 2 void GetYesOrNo (/* out */ char& response) // Inputs a character from the user // Postcondition: response.
Controlling Execution Dong Shao, Nanjing Unviersity.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
3. Controlling Program Flow Methods, parameters, and return values Boolean expressions Conditional branching Loops.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
CIS 199 Final Review. New Material Structures  Value type  NOT a reference type!  Used to encapsulate small groups of related variables.
CIS 199 Final Review. New Material Classes  Reference type  NOT a value type!  Can only inherit from ONE base class.
 Control Flow statements ◦ Selection statements ◦ Iteration statements ◦ Jump statements.
Application development with Java Lecture 6 Rina Zviel-Girshin.
CIS 200 Test 01 Review. Built-In Types Properties  Exposed “Variables” or accessible values of an object  Can have access controlled via scope modifiers.
Iteration & Loop Statements 1 Iteration or Loop Statements Dept. of Computer Engineering Faculty of Engineering, Kasetsart University Bangkok, Thailand.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
COMP Loop Statements Yi Hong May 21, 2015.
CS0007: Introduction to Computer Programming The for Loop, Accumulator Variables, Seninel Values, and The Random Class.
Today… Preparation for doing Assignment 1. Invoking methods overview. Conditionals and Loops. Winter 2016CMPE212 - Prof. McLeod1.
Chapter 7 Control Structures. Java has very flexible three looping mechanisms. You can use one of the following three loops:  while Loop  do...while.
Conditional Statements A conditional statement lets us choose which statement will be executed next Conditional statements give us the power to make basic.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
CIS199 Test Review 2 REACH.
Week 3-4 Control flow (review) Function definition Program Structures
Test 2 Review Outline.
CIS 199 Test 01 Review.
Chapter 6: User-Defined Functions I
Exam 2 Review.
Repeating Code Multiple Times
CIS 200 Test 01 Review.
Loops in Java.
Control Structures.
Chapter 5: Control Structures II
CS1010 Programming Methodology
Review If you want to display a floating-point number in a particular format use The DecimalFormat Class printf A loop is… a control structure that causes.
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT

Deitel- C:How to Program (5ed)
Functions, variables, operators, loops Modularity
CiS 260: App Dev I Chapter 4: Control Structures II.
Expressions and Control Flow in JavaScript
CIS 199 Test 01 Review.
Control Structures - Repetition
Chapter 5 - Functions Outline 5.1 Introduction
During the last lecture we had a discussion on Data Types, Variables & Operators
Design and Implementation
Objectives In this chapter, you will:
CISC124 Labs start this week in JEFF 155. Fall 2018
Computer Science Core Concepts
Chapter 6: User-Defined Functions I
CMPE212 – Reminders The other four assignments are now posted.
An Introduction to Linux
CIS 199 Final Review.
Test Review CIS 199 Exam 2 by.
1-6 Midterm Review.
Introduction to Programming
The structure of programming
CIS 199 Test 1 Review.
Thinking procedurally
Review for Midterm 3.
More Loops Topics Counter-Controlled (Definite) Repetition
Lesson 3. Controlling program flow. Loops. Methods. Arrays.
Presentation transcript:

CIS 199 Test 02 Review

Loops for while do – while foreach “For a given value X, while X is true, modify X…” while “While X is true…” do – while “Do these tasks, while X is true…” foreach “For every X in this set of Y do the following…”

for Example

while Example

do while Example

foreach Example

Key Loop Details Loops are NOT guaranteed to execute at least once! …only exception is ‘do while’ ‘for’ loops require a variable, condition, and ‘step’ instruction ‘while’, ‘do while’ loops require a boolean expression ‘foreach’ loops require a collection of items Arrays Lists Generic Collections

Files OpenFileDialog SaveFileDialog BOTH very User friendly! Used to load file from location SaveFileDialog Used to select file save location BOTH very User friendly!

OpenFileDialog

OpenFileDialog

SaveFileDialog

SaveFileDialog

Random Numbers in C# Provided from: System.Random Is ONLY pseudo-random Produces a finite set of values with equal probability Not truly random, follows a mathematical algorithm Created with OR without seed value Common methods used: Next() Next(int) Next(int, int) NextDouble()

Creating and using a Random Object

Usage & Expected Results of Random Methods

Methods Actions, code to be executed May return a value, may take value (not required) Can be controlled via scope keywords Can be static

Methods & Modularizing Your Code Break out ‘steps’ Easier to test Easier to visualize

Methods & Modularizing Your Code Example

Arrays

Arrays

Sample Questions from Blackboard Wiki

The ‘switch’ statement can replace nested if/else The ‘switch’ statement can replace nested if/else. But under what conditions? When matching on a specific… Value Type Enumeration …other data

What does a ‘break’ statement do in a loop? It stops (BREAKS) loop execution Code continues, no further loop iterations

What does a ‘continue’ statement do in a loop? Goes to the next iteration CONTINUES loop execution, by skipping current iteration

What are preconditions and postconditions for a method? Conditions that MUST be TRUE before method execution POSTCONDITIONS Conditions that WILL be TRUE after method execution

What is the difference between a void method and a value-returning method? Returns nothing! …a void return. Value-Returning Returns a value! …that’s not a void return.

Compare and contrast the use of pass by value against pass by reference, using key word ref versus pass by reference using keyword out. Pass by Value Passes a copy of the value Not the object itself Pass by Reference Passes the actual object itself ‘ref’ Causes a pass by reference on a variable ‘out’ Is used to reference a variable that the method will update

How can REACH further help you today? Ask Questions Now! Need to see an Example? Need to see a concept again? Need additional help? Visit us at: iTech Zone CRC (Ekstrom Library) Monday-Thursday 8:00am – 8:00pm Friday 8:00am – 4:00pm Sunday 12:00pm – 2:00pm (CRC Only)