In this lab i typed a program that asks the user to enter two integer numbers x and y. My experience with this lab was frustrating!!!
x=1
y=1
while (x!=0 or y!=0):
x=int( input (‘please enter integer x value:’)) # please input x value
print(‘x =’,x)
y=int( input(‘please enter integer y value:’)) # please input y value
print(‘y =’,y)
if (x==0 or y==0):
print(‘program has stop ‘)
break # if x or y are 0 program please stop
else:
x+y # calculate expression x+y
print(‘x+y=’,x+y)
x-y # calculate expression x-y
print(‘x-y=’,x-y)
x*y # calculate expression x*y
print(‘x*y=’,x*y)
x/y # calculate expression x/y
print(‘x/y=’,x/y)
x%y # calculate expression remainder
print(‘remainder is’,x%y)
if (x>y): # please check if x is greater than, less than or equal to y
print (‘value x is greater than y’)
elif x<y:
print(‘value x is less than y’)
else:
print(‘value x and y are equal’)