# Lab 3

Lab description: building a program that allow the user to do math operations like add, subtract, and multiplication using what we have learned in lab 2 “variables, data types, operators and statements and expressions.

code:

# -*- coding: cp1252 -*-
z = x+y
return z
def subtract (x,y):
z = x-y
return z
def multiply (x,y):
z = x*y
return z
def divide (x,y):
z = x/y
return z
def remainder (x,y):
z = x%y
return z
def xgy (x,y):
if (x>y):
return ( “X is greater than Y” )
elif (x<y):
return ( “X is smaller than Y”  )
elif (x == y):
return ( “x is equal to Y” )
print (“2. Subtraction”)
print (“3. Multiplication”)
print (“4. Division”)
print (“5. Remainder”)
print (“6. Comparision”)
print (“7. Exit Program”)
menu_item = input (“Which operation would you like to perform?”)
x = input (“What is your first value?”)
y = input (“What is your second value?”)
x = int (x)
y = int (y)
print (z)
subtract (x,y)
z= subtract (x,y)
print (z)
multiply (x,y)
z = multiply(x,y)
print (z)
divide (x,y)
z= divide (x,y)
print (z)
remainder (x,y)
z= remainder (x,y)
print (z)