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

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', threeIf 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

Is there a request for help on this? Your post reads like a homework question. Is it? The 19) - looks like a dead giveaway

Ask Your Question

Weekly Poll

Did you buy anything on Amazon's Prime Day?

Discuss in The Lounge

Poll History