If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

simple input/output program

ive been using c++ for a while but am having problems with my following code. i want to input 2 floating point values and then do 2 calculations on them. my problem is that it compiles but bypasses the second input and goes straight back to the prompt. but if i initialize length and width with values and dont ask for input the program works. can someone tell me what im doing wrong. thanks in advance

The bufferedReader is a much friendlier way to get input from the user.. and readLine() *does* return a String so it had to be parsed into a Float object.

Also note the change to the last two lines of the block ..
since your methods perimeter() and area() are static methods, they could not be called just by their name, the name of the class has to be prefixed since they are bound to the class.