© 2012 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3: Top-Down Design with Functions Problem Solving & Program.

Slides:



Advertisements
Similar presentations
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 6: Modular Programming Problem Solving & Program Design in.
Advertisements

© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 5: Repetition and Loop Statements Problem Solving & Program.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 10: Recursion Problem Solving & Program Design in C Sixth Edition.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 11: Structure and Union Types Problem Solving & Program Design.
Chapter 3: Top-Down Design with Functions Problem Solving & Program Design in C Sixth Edition By Jeri R. Hanly & Elliot B. Koffman.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 15: Multiprocessing Using Processes and Threads Problem Solving.
Chapter 3 Top-Down Design with Functions. 3-2 Outline 3.1 BUILDING PROGRAMS FROM EXISING INFORMATION –CASE STUDY: FINDING THE AREA AND CIRCUMFERENCE OF.
Chapter 3 Top-Down Design with Functions Part I J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
Adapted from Pearson Addison-Wesley. Addison Wesley is an imprint of Chapter 3: Math Functions Adapted from Problem Solving & Program Design in C Sixth.
COS120 Software Development Using C++ AUBG Fall semester 2010 Ref book: Problem Solving, Abstraction and Design Using C++ Authors: Frank Friedman, Elliot.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Top-Down Design with Functions Problem Solving and Program Design.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 8: Arrays Problem Solving & Program Design in C Sixth Edition.
© 2012Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 1: Overview of Computers and Programming Problem Solving & Program.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 11: Structure and Union Types Problem Solving & Program Design.
ISBN Chapter 9 Subprograms. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.9-2 Figure 9.1 The three semantics models of parameter.
Chapter 15 Geography, Climate, and Natural Resources.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 1: Overview of Computers and Programming Problem Solving &
© 2010 Pearson Education, Inc. All rights reserved.
CS 201 Functions Debzani Deb.
Chapter 2 Application Layer. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 2-2.
Chapter 6 (cont'd) Searching for Guinea Pig B: Case Study in Online Research.
Chapter 3 Top-Down Design with Functions Dr. J.-Y. Pan Dept. Comm. Eng. Nat. Chung Cheng Univ.
Chapter 13 Income Inequality. Copyright © 2005 Pearson Addison-Wesley. All rights reserved
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 2: Overview of C Problem Solving & Program Design in C Sixth.
Chapter 1 The Facts to Be Explained. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 5: Repetition and Loop Statements Problem Solving & Program.
Chapter 1 Computer Networks and the Internet. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2.
CS 201 Functions Debzani Deb.
Chapter 3 Transport Layer. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 3-2.
Chapter 6 Human Capital. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 6-2.
© 2010 Pearson Education, Inc. All rights reserved.
Chapter 8 The Role of Technology in Growth. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 8-2.
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 4: Selection Structures: if and switch Statements Problem Solving.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3: Top-Down Design with Functions Problem Solving & Program.
Chapter 1 Overview of Computers and Programming. Copyright ©2004 Pearson Addison-Wesley. All rights reserved.1-2 Figure 1.3 Components of a Computer.
Chapter 7 Multimedia Networking. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 7-2.
Chapter 16 Resources and the Environment at the Global Level.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10: Recursion Problem Solving and Program Design in C 5th Edition.
© 2012 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 2: Overview of C Problem Solving & Program Design in C Seventh.
© 2008 Pearson Addison-Wesley. All rights reserved Chapter 1 Section 9-3 Perimeter, Area, and Circumference.
Copyright © 2015, 2010, and 2007 Pearson Education, Inc. 1 Chapter 9 Geometry.
CP104 Introduction to Programming Top-down design with functions Lecture 6-8 __ 1 Top-Down Design with Functions C Library functions Case studies Top-down.
Lecture 9m: Top-Down Design with Functions COS120 Software Development Using C++ AUBG, COS dept.
1 Introduction to Computers II Lecture 4 Dr. Mehmet Demirer Dr. Seniha Esen Yuksel.
Problem Solving and Program Design in C (5th Edition) by Jeri R. Hanly and Elliot B. Koffman CP 202 Chapter 3 Slides By Dr. Daniyal Alghazzawi.
© 2012 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 9: Recursion Problem Solving & Program Design in C Seventh.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 13: Programming in the Large Problem Solving & Program Design.
Lecture 8: Top-Down Design with Functions COS120 Software Development Using C++ AUBG, COS dept.
Chapter 3 Top-Down Design with Functions and Classes Lecture Notes Prepared By: Blaise W. Liffick, PhD Department of Computer Science Millersville University.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Top-Down Design with Functions and Classes Problem Solving, Abstraction,
chap3 Chapter 3 Top-Down Design with Functions.
© 2012Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 5: Repetition and Loop Statements Problem Solving & Program.
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
Chapter 3 : Top Down Design with Functions By Suraya Alias.
Chapter 3 Top-Down Design with Functions. Copyright ©2004 Pearson Addison-Wesley. All rights reserved.3-2 Figure 3.1 Edited Data Requirements and Algorithm.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6: Modular Programming Problem Solving and Program Design in C 5th.
© 2012 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Problem Solving & Program Design in C Seventh Edition By Jeri R. Hanly.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Selection Structures: if and switch Statements Problem Solving.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Overview of Computers and Programming Problem Solving and Program.
© 2012 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3: Top-Down Design with Functions Problem Solving & Program.
CS1001 Programing Fundamental Lecture 5 Top-Down Design with Functions
Chapter 5: Repetition and Loop Statements
Chapter 3: Top-Down Design with Functions and Classes
Chapter 9: Strings Problem Solving and Program Design in C 5th Edition
Introduction: Some Representative Problems
Top-Down Design with Functions
Chapter 6 Dynamic Programming.
Top-Down Design with Functions
Presentation transcript:

© 2012 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3: Top-Down Design with Functions Problem Solving & Program Design in C Seventh Edition By Jeri R. Hanly & Elliot B. Koffman

1-2 © 2012 Pearson Addison-Wesley. All rights reserved. 1-2 Figure 3.1 Edited Data Requirements and Algorithm for Conversion Program

1-3 © 2012 Pearson Addison-Wesley. All rights reserved. 1-3 Figure 3.2 Outline of Program Circle

1-4 © 2012 Pearson Addison-Wesley. All rights reserved. 1-4 Figure 3.3 Calculating the Area and the Circumference of a Circle

1-5 © 2012 Pearson Addison-Wesley. All rights reserved. 1-5 Figure 3.3 Calculating the Area and the Circumference of a Circle (cont’d)

1-6 © 2012 Pearson Addison-Wesley. All rights reserved. 1-6 Figure 3.4 Computing the Rim Area of a Flat Washer

1-7 © 2012 Pearson Addison-Wesley. All rights reserved. 1-7 Figure 3.5 Flat Washer Program

1-8 © 2012 Pearson Addison-Wesley. All rights reserved. 1-8 Figure 3.5 Flat Washer Program (cont’d)

1-9 © 2012 Pearson Addison-Wesley. All rights reserved. 1-9 Figure 3.6 Function sqrt as a “Black Box”

1-10 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.7 Square Root Program

1-11 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.7 Square Root Program (cont’d)

1-12 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.8 Triangle with Unknown Side a

1-13 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.9 House and Stick Figure

1-14 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.10 Structure Chart for Drawing a Stick Figure

1-15 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.11 Function Prototypes and Main Function for Stick Figure

1-16 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.12 Function draw_circle

1-17 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.13 Function draw_triangle

1-18 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.14 Program to Draw a Stick Figure

1-19 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.14 Program to Draw a Stick Figure (cont’d)

1-20 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.14 Program to Draw a Stick Figure (cont’d)

1-21 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.15 Flow of Control Between the main Function and a Function Subprogram

1-22 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.16 Function instruct and the Output Produced by a Call

1-23 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.17 Lego ® Blocks

1-24 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.18 Function print_rboxed and Sample Run

1-25 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.18 Function print_rboxed and Sample Run (cont’d)

1-26 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.19 Effect of Executing print_rboxed (135.68);

1-27 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.20 Function with Input Arguments and One Result

1-28 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.21 Functions find_circum and find_area

1-29 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.22 Effect of Executing circum = find_circum (radius);

1-30 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.23 Function scale

1-31 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.24 Testing Function scale

1-32 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.25 Data Areas After Call scale(num_1, num_2);

1-33 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.26 Referencing pixels in a window

1-34 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.27 Drawing intersecting lines

1-35 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.28 Window drawn by lines.c

1-36 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.29 Drawing a house

1-37 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.30 House drawn by house.c

1-38 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.31 Program to draw a happy face

1-39 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.31 Program to draw a happy face (cont’d)

1-40 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.32 Program to draw a happy face (cont’d)

1-41 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.33 Painted house drawn by paintedHouse.c

1-42 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.34 Program to paint a house

1-43 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.34 Program to paint a house (cont’d)

1-44 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.35 Pirate drawn by pirate.c

1-45 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.36 Program to draw a pirate

1-46 © 2012 Pearson Addison-Wesley. All rights reserved Figure 3.36 Program to draw a pirate (cont’d)