 Status
Not open for further replies.
1 - 1 of 1 Posts

#### MaxBlaze89

·
##### Registered
Joined
·
1 Posts
Discussion Starter
I'm programming a caclulator with the ability to carry out addition, subtraction, modulus, division, and multiplication. I've got all of the functions correct I just need help with the MENU SYSTEM! I have it displayed: 1.Addition 2.Subtraction 3.Division 4.Multiplication 5.Modulus and it seems that my "if" statements aren't working because no matter what value(1-5) I insert it gives me the Addition program. I'll insert my program in text. Please, I know this is probably really easy to resolve so if someone could just edit my program to get it working correctly it would be a HUGE help. BTW, I have indented under my "if"s it just doesn't show up on the forum page.

print "Hello,",Name,". Welcome to Max's Calculator"

print "1.Addition 2.Subtraction 3.Division 4.Multiplication 5.Modulus"

menuchoice = integer1 = raw_input( "Enter first integer: \n")
integer1 = int(integer1)

integer2 = raw_input( "Enter second integer: \n")
integer2 = int(integer2)

print "User:",Name

sum = integer1 + integer2

print "Sum is\a ", sum

menuchoice = integer1 = raw_input( "Enter integer to be subtracted from: \n")
integer1 = int(integer1)

integer2 = raw_input( "Enter integer being subtracted: \n")
integer2 = int(integer2)

difference = integer1 - integer2

print "User:",Name

print "Operation: Subtraction"

print "Difference is\a ",difference

integer1 = raw_input( "Enter Number to be divided: \n")
integer1 = int(integer1)

integer2 = raw_input( "Enter Number to divide by: \n")
integer2 = int(integer2)

quotient = integer1 / integer2

print "User:",Name

print "Operation: Division"

print "Quotient is\a ",quotient

integer1 = raw_input( "Enter first multiplication integer: \n")
integer1 = int(integer1)

integer2 = raw_input( "Enter integer to multiply by: \n")
integer2 = int(integer2)

product = integer1 * integer2

print "User:",Name

print "Operation: Multiplication"

print "Product is\a ",product

integer1 = raw_input( "Enter first integer: \n")
integer1 = int(integer1)

integer2 = raw_input( "Enter second integer: \n")
integer2 = int(integer2)

Result = integer1 % integer2

print "User:",Name

print "Operation: Modulus"

print "Result is\a",Result

1 - 1 of 1 Posts
Status
Not open for further replies.