1. Engineering
  2. Computer Science
  3. use c to do this program...

Question: use c to do this program...

Question details
Use C++ to do this program

RIPTION 1 The division algorithm states that given two integers a and d, with d 4 0, there exists unique integers q and r such that a = d + r and 0 < r < d ,where I di denotes the absolute value of d The integers is the quotient, r is the remainder, d is the divisor, and a is the dividend You are to write a program named spHWdivision cpp that will prompt the user for a dividend and divisor and then display the division algorithms results in the sentence format below [four separate examples are shown) If a = 17 and d = 3, then q = 5 and r = 2, since 17 = (5)(3) + 2. If a 17 and d = -3, then q = -5 and r = 2, since 17 = (-5)(-3) + 2. If a -17 and d 3, then q 6 and r 1, since -17 (-6) (3) 1. If a -17 and d -3, then q 6 and r = 1, since -17 = (6) (-3) + 1. In testing your program, consider the four possible combinations of positive and negative dividends and divisors (as shown above) The C++ operators for integer division do not conform to the division algorithm. Explain in output displayed to the user of the program when to expect results that disagree with the division algorithm. The program should not attempt to resolve this issue. e sure to follow the departments programming guidelines for full credit This assignment will be graded using the grading criteria categories [C], [O], [SI and [D] for a total of 20 points When you have completed and tested the program, submit the source code by using the course submission utility r you have any difficulty in completing this assignment, be sure to get help your instructor Spend enough time with pencil and paper to satisty yourself that you truty understand the probiem and can work examples by hand before starting to write program code: you cannot explain a solution to a computer if you do not
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution