i am doing a program where I have to input an equation and from there , there must be only 5 inputs from the keyboard if more than 5 inputs are done the pgm must display an error message. The program is as follows:
int var1, var2, result;
string eq, op;
cout << "Type the equation : ";
cin >> var1 >> op >> var2 >> eq >> result;
example if the user...
User Profile
Collapse
-
Who can help?This is Urgent
-
validation
i am doing a program where I have to input an equation and from there , there must be only 5 inputs from the keyboard if more than 5 inputs are done the pgm must display an error message. The program is as follows:
int var1, var2, result;
string eq, op;
cout << "Type the equation : ";
cin >> var1 >> op >> var2 >> eq >> result;
example if the user... -
Thanks for the code, guys. Another question, I have to test the maximum input done on the screen, let me explain when keying the input after the 5th input the pgm should display a message like invalid input.
example : I type the equation
2 + 3 = 5 (input = 5 )
but if I type
2 + 3 = 5 + 0 (input more than 5)
how do I do the test since the coding is like that@
... -
Splitting a string into different variables
a string contains an equation and I have to break the string into integers and other variables :
example of the string is "2 + 3 = 5"
I have tried to use substr but it does not work as I can have "120 - 30 = 90" so the integers are of no fixed length.
How can I do that, please help! -
Who can answer this for me please, thanks?...Leave a comment:
-
Validation Of Variables
i dont know if I'm in the right thread if some1 can help me on this please:
The program should display an Invalid Input if more than 5 variables are entered, how do I do this :
Note that a, b and c must be integers
example the equation is a + b = c.
If the user enters a + b = c + d the program should display an invalid input.
#include <iostream>
#include <string>... -
I am doing it just want to confirm whether I'm doing right...Leave a comment:
-
yes I know I have to use the CIN for input
I want to know how to do the equation on a single line. Shall I use the getline() and use strings or substrings...Leave a comment:
-
proof of mathematical equation
I am new to c++ and have to write a program that takes a line of characters as its inout and represents a mathematical eqaution of the form a + b = c and checks whether it is correct. example 2 + 3 = 5 should report "CORRECT" whereas the equation 2 + 3 = 6 should report "INCORRECT" . Please do help!
No activity results to display
Show More
Leave a comment: