C# program that will act as a simple calculator. The calculator will be run from the command line and will only work with integer numbers and the following arithmetic operators + - * / % and it also must work with unary operators......i have the code working for +,-,*/,% operators........could someone help me out by providing the logic to implement unary operators +,-.......
Simply, you need a parameter of string, the string input from command line may like "a+b". After getting this string, you have to split it into operands (a and b in the Ex) and operator (+ in the Ex), check if operands are integers and operator is one of the supported operators (+,-,*,:,%). If there is an error, print out that error and exit. The user has to run your app from command line again until he input a proper parameter. Hope that help !
You instead of trying putting on us ur homework...I m providing u the following link..so try it yourself after going through the article:- http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=117