Overview | Schedule | Resources | Assignments | Home |
Enter binary (8 bits): 01010001 Unsigned int: 81 Hexadecimal: 51 Octal: 121 Two's complement: 81 Sign magnitude: 81 One's complement: 81 Excess-127: -46 ASCII: Q Pep/8: CHARO direct Floating-point: 4.25 Enter binary (8 bits): 10001000 Unsigned int: 136 Hexadecimal: 88 Octal: 210 Two's complement: -120 Sign magnitude: -8 One's complement: -119 Excess-127: 9 ASCII: N/A Pep/8: SUBX immediate Floating-point: -0.125There is a folder in the public directory of the I: drive for this course containing a Windows executable of the demonstration version which produced the above output, along with some starter C++ code which you may use. The grade for this project will be 10% for each correct interpretation, applied as a replacement for whatever grade you received on the exam (that is, if you correctly do 7 of the interpretations, I will give you 70% on the exam, if that is larger than your actual score). You may talk to other people about this project, but all code you submit must be your own (other than my starter code).
void swap(int &a, int &b) { int temp = a; a = b; b = temp; } int partition(int a[], int left, int right) { int pivot = a[left]; int i = left; for (int j = left + 1; j <= right; j++) { if (a[j] < pivot) { i++; swap(a[j], a[i]); } } swap(a[left], a[i]); return i; } // Sort array elements a[left] through a[right], inclusive. void quicksort(int a[], int left, int right) { if (right <= left) return; int i = partition(a, left, right); quicksort(a, left, i - 1); quicksort(a, i + 1, right); }
.circ
file in
your folder on the I:
drive and email me the file name (or just attach the file).Overview | Schedule | Resources | Assignments | Home |
DePauw University,
Computer Science Department,
Spring 2009
Maintained by Brian Howard
(bhoward@depauw.edu
).
Last updated