Grader: Sriram Narasimhan
The purpose of this assignment is to write a simple SAL program and use the simulator.
The user is prompted to enter an integer that is greater than zero. The SAL program determines if a user-entered integer is evenly divisible by 3, 4, and 5. The program then prints this result. Several sample runs of the program might look like:
Enter an integer > 0: 16 The integer is not evenly divisible by 3. The integer is evenly divisible by 4. The integer is not evenly divisible by 5. Enter an integer > 0: 20 The integer is not evenly divisible by 3. The integer is evenly divisible by 4. The integer is evenly divisible by 5. Enter an integer > 0: 16 The integer is not evenly divisible by 3. The integer is evenly divisible by 4. The integer is not evenly divisible by 5.
The following requirements must be followed to receive full credit for the assignment.
get_int -- a procedure to prompt for an integer, get one user-entered integer, and check if it is greater than zero.
divisible -- a procedure to check if one integer is evenly divisible by another integer. It sets a flag based on the result.
print -- a procedure to print a message about whether an integer is or is not evenly divisible based on the flag.
You are to turn in the source code for your program by using the handin2 program. When you have completed the assignment, hand in your source code by typing:
~cs354-1/bin/handin2 filename
where filename is the file containing the source code. You may receive feedback from the grader of your assignment by handing in a printout of your source code.