0
What can l do if l am creating a simple calculator class that prompt user to input operater and perfom operation?
l have write addition,subtraction,division and multiplication methods .And another method "user_choose_operation" simulating calculator class to prompt user to input operation either addition ,subtraction, division and multiplication. But now l'm stuck, l want ,if the user input "addition" then the method "user_choose_operation" must pass information to addition method.
3 Respostas
+ 1
use the many tutorials here as a base to set up your program, and for user choosing operation a multiple choice question with a switch case would be easiest if you aren't implementing GUI
+ 1
yea just have it call a function to clear choice and start over in each case statement after it returns the output
0
Thanks bro ! You are right,l need to switch to another method ,but few minutes earlier l was trying return keyword but l see that it can't switch to another method.