Problem Solving with C++ (9th Edition)
Problem Solving with C++ (9th Edition)
9th Edition
ISBN: 9780133591743
Author: Walter Savitch
Publisher: PEARSON
Question
Book Icon
Chapter 5.3, Problem 16STE
Program Plan Intro

Functions calling functions:

  • A function body can contain a call to another function.
  • It acts as same as if called from a main function.
  • The declaration for function should appear before usage of function.
  • In programs all function declarations come after main function.
  • A function call can be placed within another function’s definition.
  • The definition of one function could not be placed within body of definition of another function.

Precondition and Post conditions:

  • A function declaration comment can be written as two types of information that is precondition and post condition.
  • When a function is called, the precondition states conditions to be true.
  • The function could not be used or perform correctly unless precondition holds.
  • The post condition describes function call effect; it states conditions to be true after execution of function where precondition holds.
  • The post condition describes value returned by function if it returns one.
  • The post condition describes changes made to argument values for a function that may change values of variables.

Blurred answer
Students have asked these similar questions
Write the definition of a function add, which receives two integer parameters and returns their sum.
Give a precondition and a postcondition for the predefined function sqrt, which returns the square root of its argument.
Write a function that takes 3 integers (num,den,power) as parameters which represent the rational number num/den and its power and returns the difference of these two fractions. (A/B) to the power of n = A to the power of n/B to the power of n • den can not be zero. • use simplify function.

Chapter 5 Solutions

Problem Solving with C++ (9th Edition)

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education