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, Problem 2PP
Program Plan Intro

Program plan:

  • Include the header file and use the namespace std for standard I/O.
  • Define the function fractionToDecimal(double numerator, double denominator). The function will return the decimal part that is the resultant of division.
  • Define the main function.
  • Declare the variables num and den.
  • Prompt the user to enter the numerator and denominator.
  • Read the numerator and denominator in variable num and den.
  • Call function fractionToDecimal using num and den as paramters.

Program description:

The main purpose of the program is to implement the below function into the driver function.

  doublefractionToDecimal(doublenumerator,doubledenominator){return(numerator/denominator);}

Blurred answer
Students have asked these similar questions
Urgent help needed!#!
For each of the following functions, indicate how much the function’s value will change it its argument is increased Triple.
2. For each of the following functions, indicate how much the function's value will change if its argument is increased fourfold. a) log₂n b) √n c) n²
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
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning