Solved if user enter 1 then perform addition

October 14, 2016 at 08:25:26
Specs: Windows 7

19) - Write a program that simulates a simple calculator. It takes three integers as input. Third integer will decide the operation which you want to perform on first two integers.
• If user enters 1 as third integer, then perform addition.
• If user enters 2 as third integer, then perform subtraction.
• If user enters 3 as third integer, then perform division.
• If user enters 4 as third integer, then perform division

See More: if user enter 1 then perform addition

Reply ↓  Report •


#1
October 14, 2016 at 09:41:07
✔ Best Answer
Ussually if I have no idea where to start I plan the idea in psudocode.

Prompt 'first int', one
Prompt 'second int', two
Prompt 'calc function', three

If three == 1:
set calc = '+'

If three == 2:
set calc = '-'

If calc == 3:
set calc = '/'

If calculator == 4:
set calc= '*'

Output one three two

::mike

message edited by mikelinus


Reply ↓  Report •

#2
October 18, 2016 at 09:14:29
Is there a request for help on this? Your post reads like a homework question. Is it? The 19) - looks like a dead giveaway

Reply ↓  Report •

Related Solutions


Ask Question