C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter E, Problem E.7E
Program Plan Intro

Program Plan:

  • Include the required header files.
  • Declare function prototype which is used in the program.
  • Define the “main()” function.
    • Define the 3 variables to take values from keyboard.
    • Define 1 more variable to take the return value from the function.
    • Make a call to the function MINIMUM3 which uses MINIMUM2 two times to find out the smaller number among three given numbers.
    • here we will use the function MINIMUM2 2 times,
    • First time we call and we will send 2 out of 3 values and function will return
      us the minimum of those two values.
      And then again we will send the minimum value we got from the previous
      step and the remaining 3rd value and then function will return us the smaller of those two value and that will be our smallest value among the 3 given value.
  • Function “MINIMUM3 (intint) "
    • the function has three parameters which accepts the values when main function calls the function
    • and then it uses the function MINIMUM2 () 2 times to calculate the smallest among three given values
    • returns the smallest value to the calling function
  • Function “MINIMUM2 (intint) "
    • The function has two parameters which accepts the values when main function calls the function.
    • It calculates the smaller number with the use of "Lessthan" operator.
    • Returns the smaller value.

Blurred answer
Students have asked these similar questions
Using Python & import sys  Create a program that has a function that takes as arguments a first and last name and creates a username. The username will be the first letter of the first name in lowercase, the last 7 of the last name in lowercase, and the total number of characters in the first and last names.  For example, Eastern University would be eversity17. The program should print "Your username is x" where x is the username.
The programming language is python.
Task 13 Write a python function that will perform the basic calculation (addition, subtraction, multiplication and division) based on 3 arguments. They are: Operator (+,",Y.") • First Operand (any number) • Second Operand (any number) Your first task is to take these arguments as user input and pass the values to the function parameters. Your second task is to write a function and performs the calculation based on the given operator. Then, finally return the result in the function call and print the result. Input: 10 20 Function Call: function_name("+", 10, 20) Output: 30.0
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr