Lab2

Lab description: Write a program that asks the user to enter two integer numbers x and y. The program should ask the user to select one of the following operations and display the results back:

# Oluwadare AKinfenwa
# Date: 3/09/2013
# Section:9310
# Title: Lab2

X = input (‘Enter the number for X:’)
Y = input (‘Enter the number for Y:’)
while (X!=0) and (Y!=0):
print ‘Enter 1 to add the numbers.’
print ‘Enter 2 to subtract the numbers.’
print ‘Enter 3 to multiply the numbers.’
print ‘Enter 4 to divide the numbers.’
print ‘Enter 5 to find the remainder of two numbers.’
print ‘Enter 6 to see if X is greater than, less than or equal to Y’
z = input (‘Enter your Selection’)

if z==1:
result = X+Y
print ‘the sum of ‘,X,’and’,Y,’is:’,result

elif z==2:
result = X-Y
print ‘the difference of ‘,X,’ and ‘,Y,’is:’,result

elif z==3:
result = X*Y
print ‘the product of’,X,’and ‘,Y,’is:’,result

elif z==4:
result = X/Y
print ‘the qoutient of’,X,’and ‘,Y,’is:’,result

elif z==5:
result = X%Y
print ‘the remainder of ‘,X,’ and ‘,Y,’is’,result

elif z==6:
if X>Y:
print ‘X is greater than Y’
elif X<Y:
print ‘X is less than Y’
else:
print ‘X is equal to Y’

X = input (‘Enter the number for X:’)
Y = input (‘Enter the number for Y:’)