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 13E

(a)

Program Plan Intro

Program plan:

  1. DeclarevariablesintNumberof type int.
  2. DeclarevariablesfracNumber of type double.

Program description:

The main purpose of the function is to accepts argument number and returnfractional part of the number.

(b)

Program Plan Intro

Program plan:

4. Declarevariablestest1and test2to test the function.

5.Use cout statement to print statement.

Program description:

To include the function written for (a) in a working program.

Blurred answer
Students have asked these similar questions
(Perfect Numbers) An integer number is said to be a perfect number if its factors, including1 (but not the number itself), sum to the number. For example, 6 is a perfect number because 6 =1 + 2 + 3. Write a function isPerfect that determines whether parameter number is a perfect number. Use this function in a program that determines and prints all the perfect numbers between 1and 1000. Print the factors of each perfect number to confirm that the number is indeed perfect.Challenge the power of your computer by testing numbers much larger than 1000.
(Intro to Python) Write complete python program that defines and calls a function isEvenNumber which takes one parameter and prints whether the number is even or odd. Prompt the user to enter a number and call the function passing the number as an argument to generate the following output. Zero can be classified as even. Sample output is: Enter a number: -5 -5 is odd number or Enter a number: 12 12 is even number
(Perfect Numbers) An integer is said to be a perfect number if the sum of its divisors, including 1 (but not the number itself), is equal to the number. For example, 6 is a perfect number, because   6=1+2+3. Write a functionisPerfect that determines whether parameter number is a perfect number. Use this function in a program that determines and prints all the perfect numbers between 1 and 1000. Print the divisors of each perfect number to confirm that the number is indeed perfect. Challenge the power of your computer by testing numbers much larger than 1000.
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