Hello, I am doing a project mainly using functions and the if else statement (its what I have learned so far) and I am to get user input and simply do some math depending on what operators they picked. The code below seems a bit redundant but I am using everything I have covered up until now, so excuse my noobish ways.
So far I have like a menu
1) Add
2) Subtract
3) Divide
4) Multiply
User selects an option, they input 2 numbers, I calculate and print it on the screen. My code works fine, and I got it to do what I wanted but once the calculation is over, I want to clear all the text on the prompt and have the user see only the menu selection again incase they want to process another option. Thing is I have no idea how to reinitiate these menus, do I have to call main again?
take a look at loops, you should be able to figure it out from that, you could call main if your compiler allows doesn't stop it, but it isn't standard c++ and shouldn't be used.
I see, its something extra I wanted to add to the project but it wasn't asked for. The next couple videos I am watching do go into the loops but I am still messing around with functions till I feel positive to go on to the rest. At least I know I will soon be able to code this into my program if I learn loops.
Thanks for the link to the article about clearing the screen, much appreciated!