Functions That Do Not Return a Value 03/09/11. Reminders  Quiz 3 Friday Work with partner on for-loop activity. Work with partner on for-loop activity.

Slides:



Advertisements
Similar presentations
Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
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.
Logic & program control part 3: Compound selection structures.
String and Lists Dr. Benito Mendoza. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list List.
Fall 2008Programming Development Techniques 1 Topic 2 Scheme and Procedures and Processes September 2008.
Mock test review Revision of Activity Diagrams for Loops,
Computer Science 1620 Loops.
COMP 14 Introduction to Programming Mr. Joshua Stough February 21, 2005 Monday/Wednesday 11:00-12:15 Peabody Hall 218.
Chapter 4 Summation.
More loops Linag, Chpt 3, pp The do-loop continue- condition ? loop-body statements next statement false true WHILE-LOOP continue- condition? loop-body.
 To be able to write larger programs ◦ By breaking them down into smaller parts and passing data between the parts.  To understand the concepts of Methods.
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
CIS3931 – Intro to JAVA Lecture Note Set 3 19-May-05.
Hello AP Computer Science!. What are some of the things that you have used computers for?
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
Programming Languages -1 (Introduction to C) arrays Instructor: M.Fatih AMASYALI
Module Name: ASAP 1.What do you want the student to be able to do? -> Determine the credibility of an information source using the ASAP test. 2. What does.
For Loops 2 ENGR 1181 MATLAB 9. For Loops and Looped Programming in Real Life As first introduced last lecture, looping within programs has long been.
Copyright 2009 by Pearson Education Building Java Programs Chapter 2 Lecture 2-2: The for Loop reading: 2.3 self-check: exercises: 2-14 videos: Ch.
Control Structures if else do while continue break switch case return for.
 What is Algebraic Expressions and how do I solve them?
AE1205 Programming Python Quiz: so how do we generate Numbers 1 to 10? range( ) Numbers 5,10,15,20,25 to 100? range( ) Numbers 20,18,16, to 0? range( )
Textbook Problem Java – An Introduction to Problem Solving & Programming, Walter Savitch, pp.219, Problem 08.
Module Name: Examine Every ASPECT 1.What do you want the student to be able to do? -> Determine the credibility of an information source using the ASPECT.
Quiz Answers 1. Show the output from the following code fragment: int a = 5, b = 2, c = 3; cout
Hey, Ferb, I know what we’re gonna do today! Aims: Use formatted printing. Use the “while” loop. Understand functions. Objectives: All: Understand and.
Additional Control Structures. Chapter 9 Topics Switch Statement for Multi-way Branching Do-While Statement for Looping For Statement for Looping Using.
For loops in programming Assumes you have seen assignment statements and print statements.
DO NOW MONDAY 3/19 -YOU ARE GOING HOME FROM SCHOOL YOU TRAVEL 4 KM, YOU DECIDE TO STOP AT THE MALL WHICH IS ANOTHER 4 KM, THEN YOU GRAB DINNER AT TACO.
A First Book of ANSI C, Fourth Edition1 Functions for Modularity 04/24/15.
Intro to Java Day 3 / Loops 1. DAY 3 Java Language Specifications Conditional Loops while do for References: JavaNotes7 pdf bookJavaNotes7 pdf book.
CS Class 08 Today  Exercises  Nested loops  for statement  Built-in functions Announcements  Homework #3, group solution to in-class.
Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
BIT 115: Introduction To Programming Professor: Dr. Baba Kofi Weusijana (say Doc-tor Way-oo-see-jah-nah, Doc-tor, or Bah-bah)
February ,  2/16: Exam 1 Makeup Papers Available  2/20: Exam 2 Review Sheet Available in Lecture  2/27: Lab 2 due by 11:59:59pm  3/2:
Day 2 of 5 Emulation Project # Bell Work Take out your project #1 from the folder If you do not have a project complete the form, get one.
 2007 Pearson Education, Inc. All rights reserved C Arrays.
1 Printing in Python Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external files.
1 do-while Statement 2 Do-While Statement Is a looping control structure in which the loop condition is tested after each iteration of the loop. SYNTAX.
Nested for loops.
Printing with for Loops To print a character multiple times, use a for loop. for (int j = 1; j
MCS 118 Fall 2013 September 23, GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Announcements Quiz next Monday. If you need accommodations, see me. MCS 118,
Arrays as pointers and other stuff COP3275 – PROGRAMMING USING C DIEGO J. RIVERA-GUTIERREZ.
1 Programming in C++ Dale/Weems/Headington Chapter 9 Additional Control Structures (Switch, Do..While, For statements)
Review (before the 1 st test): while (conditions) { statements; } while loop: if/else if/else statements: if (conditions) { statements; } else if (different.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
1 BUILDING JAVA PROGRAMS CHAPTER 2 PRIMITIVE DATA AND DEFINITE LOOPS.
Microsoft® Small Basic Conditions and Loops Estimated time to complete this lesson: 2 hours.
Announcements. Practice questions, with and without solutions will be uploaded by Friday 5 th November, make sure to check them before the weekend \\netstorage\Subjects\ITCA-b\Exam.
String and Lists Dr. José M. Reyes Álamo. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list.
ПЕЧЕНЬ 9. Закладка печени в период эмбрионального развития.
Homework 1 (due:April 13th) Deadline : April 13th 11:59pm Where to submit? eClass 과제방 ( How to submit? Create a folder. The name.
Exercise 2 : Using for loop Repetition (loop) (1)control variable initialization (2)Test Conditon (3)Modification of control variable value order : (1)
Chapter 8: More on the Repetition Structure
Make Your Own Quiz.
Alice in Action with Java
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Functions A function is a “pre-packaged” block of code written to perform a well-defined task Why? Code sharing and reusability Reduces errors Write and.
المدخل إلى تكنولوجيا التعليم في ضوء الاتجاهات الحديثة
Count Controlled Loops (Nested)
Functions as everyday items
Console.WriteLine(“Good luck!”);
Chapter 7: User-Defined Functions II
Program Flow.
The structure of programming
Print the following triangle, using nested loops
Functions That Do Not Return a Value
Presentation transcript:

Functions That Do Not Return a Value 03/09/11

Reminders  Quiz 3 Friday Work with partner on for-loop activity. Work with partner on for-loop activity. pp pp

void Functions  We have written functions that return a value.  Can write functions that don't return anything.  ch5/circle1.cpp instructions( ) function prints, but doesn't return a value. instructions( ) function prints, but doesn't return a value.

void functions  start with "void"  return statement w.o. value  return statement is optional  A call to the function stands alone as statement.

void functions  function could be passed value  starSqWhile.cpp Has a void function to print square of asterisks Has a void function to print square of asterisks Nested loop Nested loop

Linux Redirection  a.out < dataIn.txt  a.out > dataOut.txt  Pipeline One process gets output of previous One process gets output of previous

For Next Monday  Read pp Tables, , do- while. Also nested loops.