COSC 1435 Bonus Lab

 

Purpose: This lab is to look at how to manipulate numbers, by developing a program that displays the manual process of long division of integer numbers that you learned in elementary school.

Due: May 8, 2013

Requirements: Do the following:

1. Write a program that inputs two two numbers. Write the program so that it divides the first number by the second and display the long division process as if you were doing long division by hand. All of the long division process must work properly. Show the remainder, when the integer division is complete. The program must work properly for all positive and negative integers, except division by zero (check for this and give an error message). This program must go through/show all the intermediate steps that occur during long division, giving just an answer, even if correct, does not satisfy this lab. Hints:

I recommend you do this program in phases, but for this lab, you need only turn in the final completed lab. I recommend that you break the project into phases as follows:

2. Allow the user to input multiple pairs of numbers to be divided.

3. Make sure your program is properly documented and good programming standards are followed, including properly type casting conversions between variable types. There should be no float or double variables in the program.

4. Try your program with a variety of input values, to determine it works properly. For test values, I suggest you use these pairs of numbers: 1 / 0, 1 / 1, -1 / 2, 5 / 3, 3 / 5, 1 / -999999, 10 / -2, 73 / 21, 95483 / 4381, and -9654223 / 23167.

5. Prepare a lab report/documentation package. All of these items do not need to be in the same file or word document, but the main lab report file must reference each item by name. Make sure a digital copy of each item is attached to the email. The lab report must includes the following information for the final program:

Program Submission. You will be submitting this lab via Blackboard. The teaching assistant will provide further instructions on how to accomplish this. Prepare the following:

  • Your program source code. This file should be called lab15***.cpp, where the *** is replaced with your initials.
  • A copy of your program output saved as a file. This file should be called lab15***.txt, where the *** is replaced with your initials. The .txt signifies that this is an ASCII text file.
  • A lab report as described above. The lab report may be in a Microsoft Word document, with a .doc suffix or an ASCII text file with a .txt suffix. Make sure it contains all of the required items. This file should be called either lab15***doc.txt for a text file or lab15***doc.doc for a Microsoft Word file, where the *** is replaced with your initials.

Submit via blackboard following the instructions given during the lab.

Grading Criteria: 100 points available for this lab. 40 bonus points availble as described in Part D above.