C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
Question
Book Icon
Chapter 6.2, Problem 1E
Program Plan Intro

Program plan:

  • Include the header file and use the namespace std for standard I/O.
  • Declare the function findMax(double, double).
  • Define the main function.
  • Declare the variables to store the two double-precision value.
  • Prompt the user to enter the values and storing them.
  • Call the findMax() and storing the value returned by it.
  • Display the maximum number among the two numbers.

Program description:

The main purpose of the program is to modify the program written in exercise 6.5 so that the function findMax() returns the double-precision value to the main function. After the modification the findMax() function takes two double-precision values as the function argument and returns the largest among them.

Blurred answer
Students have asked these similar questions
(Use Python)Use the Design Recipe to define a function called is_multiple that consumes two parameters num1 and num2 in that order and returns True if num1 can be divided evenly by num2 otherwise it returns False. Include a docstring!   Write 3 assert_equal  statements to test your function.
(Hypotenuse) Define a function hypotenuse that calculates the length of the hypotenuse of a right triangle when the other two sides are given. Use this function in a program to determine the length of the hypotenuse for each of the triangles shown below. The function should take two double arguments and return the hypotenuse as a double. Sample output Enter 2 sides of right triangle: 3.0 4.0 Hypotenuse: 5.0 Enter 2 sides of right triangle: 5.0 12.0 Hypotenuse: 13.0 Enter 2 sides of right triangle: 8.0 15.0 Hypotenuse: 17.0
(Signal Handling) Read the documentation for your compiler to determine what signals are supported by the signal-handling library (). Write a program that contains signal handlers for the standard signals SIGABRT and SIGINT. The program should test the trapping of these signals by calling function abort to generate a signal of type SIGABRT and by having the user type c ( C on OS X) to generate a signal of type SIGINT.
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