[Dev-C++] please help me to write formulas
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jalal S. <jl...@ya...> - 2005-03-27 05:49:04
|
Hi I am new here (and still studying C++), I would love to know how to do make my program check out the type of the user input, to make it more clear, am trying to write geometric formulas ...... and it works by making the user enter his datas // height area width etc....and lets say am doing the square function (not a class because am practicing now functions and I would like to take my time before I use classes) and in square function lets say that there are these (formulas): area = height * width; // this is in case the MISSING variable (input) is the area height = area / width; // in case the MISSING input is the Height and so on remember please that the user must enter the data and if he wites x or y (height, width) then the formula that needed to find (any missing argument or a value of variable) takes the action to do that, but how to make the program check what type of the input if I HAVE TO declare a variable for output (cin >> float a; for example). I mean the user cant type x or y if the out put is float //which should be! please help me, and thank very much. ligeti_78 --------------------------------- Do you Yahoo!? Make Yahoo! your home page |