For my beginners C++ class...basic code but im really stuck on it. THANK YOU in advance. the instructions are as follows....
Write a program using a For statement in a pretest loop that allows a user to correctly output 5 correct arithmetic problems. input errors are not to count towards the number of correct arithmetic problems. Provide logical prompts to the user describing how the program is to work. Ask the userfor two numbers and a character representing the desired arithmetic operation. use a switch statement to determine which operation to perform. If the user enters faulty data, the program should output an appropriate error message. Display the answers to each problem as well as the error message associated with the third input.
So whats your problem... where are you stuck at... what do you have so far? These are all the questions I have for you because to be blunt we aren't going to do your homework for you. So post what you have so far and we can help you figure it out and remember to use code tags (Hint: the <> off to the right when replying).
Why don't you post what you have so far and we can help you. The hardest part of this exercise will be the error handling. There are multiple ways of handling them, for example lets say the user inputs a incorrect operator. You could use something like this to handle the error for the operator.
this here is bucky, he is the most efficient way to learn c++, he is your teacher now this episode is the first i found its on recursion witch is most definatley too advanced for you today but watch enough of these and practice and you will get the basics in only a few days
i think its almost beautiful, if you want to please everyone get rid of system pause its a security problem in future codes and namespace std could me a bit more local (eg:std::cout) and a few comments and more self explanatory variable names and we have what people call beautiful code.
i am in the process of learning this now i have the basics down
Don't know what your talking about a few more comments and more self explanatory variable names... If anything it could use less comments and the variables explain themselves ;)
Also if your going for perfection you don't need to declare int counter = 1; outside of your for loop. You can do this for (int counter = 1; counter < 6; counter++). Notice also that you can increment the counter inside it also.