469,600 Members | 2,393 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,600 developers. It's quick & easy.

Convert Integer?

Writing program to calculate cir., area, etc. of circle. Radius is input as integer; how to convert integer to proceed with calculations?
Apr 8 '10 #1
2 2209
jkmyoung
2,057 Expert 2GB
1. List your outputs and figure out what type of variable they should be.
2. Find the formulas for each of your outputs based on your input.
3. Program these formulas in.

Show code that you're using so far. Are you using a Scanner?
Expand|Select|Wrap|Line Numbers
  1.  Scanner sc = new Scanner (System.in);
  2. int radius = sc.nextInt();
Apr 8 '10 #2
Actually, you led me in the right direction, but this is what I did and program ran;

System.out.print( "Enter radius: " ); // prompt
radius = input.nextInt(); // read first entry from user

Thanks!
Apr 9 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Logan X via .NET 247 | last post: by
3 posts views Thread by Convert TextBox.Text to Int32 Problem | last post: by
3 posts views Thread by Mike Miller | last post: by
7 posts views Thread by Scott Schluer | last post: by
5 posts views Thread by Mika M | last post: by
20 posts views Thread by Niyazi | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.