CS 222-01-14W: Data Structures Program 1 Long Division

$30.00

Category:

Description

5/5 - (4 votes)

Write a program in C++ that prompts the user for two positive integers (you do not need to
verify that the two numbers are positive). You are to compute the exact decimal answer as a
result of dividing the first number by the second.
Example:
Enter a numerator: 14
Enter a denominator: 7
14/7 = 2
Example:
Enter a numerator: 2
Enter a denominator: 7
2/7 = 0.(285714)
Example:
Enter a numerator: 1
Enter a denominator: 12
1/12 = 0.08(3)
Example:
Enter a numerator: 101
Enter a denominator: 10
101/10 = 10.1
If the denominator evenly divides the numerator, GREAT! However, there is no guarantee that
this will happen and you are to compute the EXACT decimal division of the two numbers,
putting repeating portions (if there is one) in parentheses.
Be sure your program is divided into appropriate methods and commented well. You should put
all of this into a directory in the root of your submission folder entitled “PG1”. Place a (possibly
empty) file called “DONE” in this folder when you are ready for your program to be graded.