Revised:
|
|
|
Assign. Number |
Description |
Due Date |
Points |
| 1 |
Write a Java or C++ program that will convert an array of char supplied in hex, octal, binary or decimal and print out a the number as a string or array of char in all four formats stated above.
Specifications:
- The program cannot perform I/O on integer data types. Example, if x is an integer, the statements
System.out.println(x) or printf("%d",x) (or %o, %x etc) or cout << x are not permitted. I/O can only be performed on characters.
- The program can only read and write single characters, not entire strings.
- The program must contain a class called Base_Number that has has either a character array and number of characters in the array OR a sentinel-terminated array as private data members ((methods) of the class.
- The class is to have public function members (methods) called
- toNumber which returns the integer represented by the data array.
- toCharacter which takes as parameters the integer the base of the number. That charater string is to be placed in the array method (member) of the object.
- printNumber which prints one character at a time, the contents of the data array.
- A constructor that initalizes the object.
- A boolean method (member) called isValid validates input in so far as the characters within the data portion are valid for that number type.
- Program is not to deal with numbers greater than 32767 or negitive numbers.
- The only package / library functions you are allowed to use are I/O of single characters, You may use library functions such as
clrscr for output enhancement.
- Code must be modularized.
- The toNumber method is to convert the input string into an integer using Horners' Method.
- The program must contain functions and/or procedures to validate input.
|
10/13 |
50 |
|
| 2 |
Write an assembly language program that prints your name and on a separate line and the name of a friend or family member. The program must use two $ terminated strings.
|
10/6 |
10 |
|
|
| 3 |
Write an assembly language program that prompts the user for a numerator and denomenator and prints
X/Y = Q r R
where X and Y are the numbers entered and Q and R are the results of the operation
|
10/21 |
20 |
|
| 4 |
Write an assembly language program that that calls the interrupt to get the current system time.
The program cannot use macros and the only library call you may use is PUTDEC.
Format of the output myst ne time the form hh:mm:ss (2 digit, leading 0). You cannot use any assembler beyond the current section of
the text book.
|
10/21 |
20 |
|
| 5 |
Write an assembly language program that computes the quantity b2 - 4ac. The quantities a, b and c are to be input into the program using the GETDEC routine. Choose the values for a, b and c such that b2 and 4ac do not exceed 255.
Note: Due date changed to 2/23
|
11/10 |
10 |
|
| 6 |
Write an assembly language program that computes the quantity b2 - 4ac. The quantities a, b and c are to be input into the program using the GETDEC routine. Choose the values for a, b and c such that
b2 and 4ac do not exceed 255 and prints
Two Real Root if b2 - 4ac > 0
One Real Root if b2 - 4ac = 0
No Real Roots if b2 - 4ac < 0
|
11/10 |
20 |
|
| 7 |
Write an assembly language program that simualtes the following program:
writeln('Enter multiple');
readln(mult);
writeln('Enter ending value');
readln(stop);
for i:= 1 to stop do
writeln(i*mult);
- The assembly language program must use a register to control the loop by computing the number of iterations prior to execution of the loop.
- The program cannot use the a multiplcation instruction.
PUTDEC and GETDEC are allowed.
|
11/10 |
20 |
|
| 8 |
Write an assembly language program that performs a rot13 encoding of input until EOF is encountered. The program is to have a subprogram called ROT13 that takes the character in al and returns the (possibly) rotated character in the al.
ROT13 (short for ROTate 13 characters) has been in use since the start of the Internet. The purpose was to provide a mechanism where text could/would not be accidently read (example: is you were speaking about the ending of a mystery story).
The ROT13 algorithm is as follows:
The letters A through M are mapped to the letters N thorugh Z. The letters N through Z are mapped to the letters A through M. All other characters (digits, punctuation, spacing, etc) are left uneffected.
Example: The word AND is mapped to the word NAQ through ROT13. The word NAQ is sent back to AND when a ROT13 is performed on it.
Remember, the lowercase letters and uppercase letters are different.
Verify that your program works correctly. Type in:
Vs lbh pna
ernq guvf, gura lbhe
cebtenz JBEXF!
If you then type the message you get out into your program, you should get what is above.
|
11/10 |
20 |
|