Welcome to Dream.In.Code
Become a Java Expert!

Join 150,035 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,587 people online right now. Registration is fast and FREE... Join Now!




feranite to conversion

 
Reply to this topicStart new topic

feranite to conversion, help it out

prajayshetty
11 Jun, 2008 - 08:49 AM
Post #1

D.I.C Head
Group Icon

Joined: 27 Apr, 2007
Posts: 230



Thanked: 1 times
Dream Kudos: 25
My Contributions
as per to previous post thats scanner works just fine in the previous post reply thanks for u all for that scanner suggestion
here
here is the code
CODE

import java.util.*;
import java.lang.*;
public class expf
{
public static void main (String args[])
{
    Scanner in = new Scanner(System.in);
    double degree=10.0;
    double feranite=20.0;
    String line;
    try
    {
        System.out.println("Enter the degree");
        line=in.nextLine();
        feranite=Double.valueOf(line);
           
    }
catch(Exception e)
{
}
degree=(((feranite)-32)/(1.8));
System.out.println("the value of feranite is"); // here
System.out.print(degree);
}
}

instead of u using that two system.out statement can i make it one it doest go though in simple system.out.println statement therefore i have to again print through system.out.print
ne other way u guys know thanks for info

This post has been edited by prajayshetty: 11 Jun, 2008 - 09:19 AM
User is offlineProfile CardPM
+Quote Post

Locke37
RE: Feranite To Conversion
11 Jun, 2008 - 09:29 AM
Post #2

Contributor of the Year
Group Icon

Joined: 20 Mar, 2008
Posts: 1,274



Thanked: 57 times
Dream Kudos: 325
My Contributions
Yeah, you can just do this,

java
System.out.println("the value of feranite is " + feranite);


That'll put it all on one line.
User is offlineProfile CardPM
+Quote Post

prajayshetty
RE: Feranite To Conversion
11 Jun, 2008 - 09:38 AM
Post #3

D.I.C Head
Group Icon

Joined: 27 Apr, 2007
Posts: 230



Thanked: 1 times
Dream Kudos: 25
My Contributions
QUOTE(Locke37 @ 11 Jun, 2008 - 10:29 AM) *

Yeah, you can just do this,

java
System.out.println("the value of feranite is " + feranite);


That'll put it all on one line.

that wont work it gives error
User is offlineProfile CardPM
+Quote Post

mensahero
RE: Feranite To Conversion
11 Jun, 2008 - 09:52 AM
Post #4

c0mput3rz Are Only Human
Group Icon

Joined: 26 May, 2008
Posts: 664



Thanked: 17 times
Dream Kudos: 75
My Contributions
CODE

System.out.println("the value of feranite is " + degree);


I think it should be degree.. and prajah could you give a more informative description of the exact error.. could you post the exact error? blink.gif

IMO what locke said would work..
User is offlineProfile CardPM
+Quote Post

prajayshetty
RE: Feranite To Conversion
11 Jun, 2008 - 09:55 AM
Post #5

D.I.C Head
Group Icon

Joined: 27 Apr, 2007
Posts: 230



Thanked: 1 times
Dream Kudos: 25
My Contributions
QUOTE(mensahero @ 11 Jun, 2008 - 10:52 AM) *

CODE

System.out.println("the value of feranite is " + degree);


I think it should be degree.. and prajah could you give a more informative description of the exact error.. could you post the exact error? blink.gif

IMO what locke said would work..


well its a problem in mine code i compiled again it now working thanks
well this is fun in learning java programming with u guys actually there were 2 files i forgot to remove one mine mistake

This post has been edited by prajayshetty: 11 Jun, 2008 - 09:55 AM
User is offlineProfile CardPM
+Quote Post

Locke37
RE: Feranite To Conversion
11 Jun, 2008 - 06:54 PM
Post #6

Contributor of the Year
Group Icon

Joined: 20 Mar, 2008
Posts: 1,274



Thanked: 57 times
Dream Kudos: 325
My Contributions
Ah yes, it should have been degree. Good catch Mensa. I guess I just wasn't paying close enough attention. icon_up.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 09:44PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month