-
Printing out numbers onto the console
Hi I'm doing a exercise which requires a user interface. I have coded prompts for the user e.g.
Please Enter Amount (type double)
Please Enter Agreed Interest Rate (type double)
.......e.t.c
What seems to be happening is:
1) When I enter an amount (type double) a different amount will printout onto the console screen e.g
I enter 8.0
|
|
v
Console screen prints out 56.0 ????
2) After I enter the one amount the console will not allow me to enter the amounts for the other options ???
I am using Eclipse Gallello (sorry for spelling)
Code
=======
public class Comp_Interest_Calc_tut
{
public static void main(String[] args)
throws java.io.IOException
{
* Variables have already been declared*
System.out.println("Enter Years");
Years_In = (double)System.in.read();
System.out.println(Years_In);
System.out.println("\n");
System.out.println("Enter Agreed Interest Rate");
InterestRate_PA = (double)System.in.read();
System.out.println(Years_InterestRate_PA);
}
}
Similar Threads
-
Replies: 1
Last Post: 04-28-2008, 12:26 PM
-
Replies: 1
Last Post: 10-02-2006, 12:22 PM
-
By kanakatam in forum Java
Replies: 1
Last Post: 05-31-2006, 02:14 AM
-
By sensei in forum VB Classic
Replies: 1
Last Post: 05-18-2006, 01:25 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks