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
Problem 2. Evaluate the expressions in each of the following triples:     (a)       8   (mod 3)       =                   12   (mod 3)     =                   8 + 12   (mod 3)     = ​
Computer Science f(x)= Sin(x) – x 3 + C Where C = Max [0.15, (69/100)] x20, (x is in radian). Apply the false position method three iterations to find the root of the function (Decide the starting values of Xl and Xu yourself)
Problem 2. Evaluate the expressions in each of the following triples:​     (c)       3   (mod4)       =                 10   (mod4)     =                 3·10   (mod4)       =
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