Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners programming code
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Louis Brown
programming code
1 Answer(s)      5 years and 7 months ago
Posted in : Java Beginners



Advertisement
View Answers

May 4, 2009 at 11:20 AM


Hi Friend,

Try the following code. I will really help you.

import java.io.*;
import java.util.*;
class TemperatureConverter {
public static void main(String[] args) throws Exception{
System.out.print("Enter the Temperature: ");
Scanner input=new Scanner(System.in);
double temp=input.nextDouble();
System.out.print("Enter unit F or C: ");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String unit = br.readLine();
if((unit.equals("F"))||(unit.equals("f"))){
double c= (temp - 32) / 1.8;
System.out.println(c+" Celsius");
}
else if((unit.equals("C"))||(unit.equals("c"))){
double f=(temp*1.8+32);
System.out.println(f+" Fahrenheit");
input.close();
}
}
}

Thanks


Related Tutorials/Questions & Answers:
java programming code
java programming code  strong textHi I need the java code... are in inverted commas thank you. Blockquote HARDWARE ITEMS CODE DESCRIPTION UNIT...:" Apt 23" ADDRESS-2:" Building 8" ADDRESS-3: ""Winchester" POST CODE: "89763
programming code - Java Beginners
programming code  program code for converting temperature from celsius to fahrenheit or fahrenheit to celsius using if-then-else to decide if celsius or fahrenheit is entered   Hi Friend, Try the following code. I
Advertisements
Java Programming Code HELP
Java Programming Code HELP  Hi, sir/madam. I am new here and currently developing a program whereby it can read the Java source file...: String, attribute name = variable name) Below are my source code. Hope
game programming code - Swing AWT
game programming code  write a snake program using swings with step by step explanation?. please send me this source code to my mail id with step by step explanation
java programming code - Java Beginners
java programming code  I want to write a program that converts temperatures from celsius to fahrenheit and vice versa. It also converts kilometers to miles and vice versa using classes
java programming code - Java Beginners
java programming code  Design and write a Java application that takes... No digit corresponds to either Q or Z. For the two letters, your application should...;Hi Friend, Try the following code: import java.util.*; import
Programming
Programming  Given a number n, write a programming to determine its square root if it is possible, in the contraly case print an appropriate massege on the screen
programming
Java Constructor programming for single and double constructor  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object
programming
programming  if we write a code for nearest no divisible by 5 example: given no divisible by 5 nearest no 12... for the waiting of ur answer ur friend`print("code sample
Programming
(); } } Is this code is beneficial for you. For further issues feel free to ask
java programming code to upload a dataset(text file) and show the values in graphically view
java programming code to upload a dataset(text file) and show the values in graphically view  how can be done upload a dataset(text file) and show the values in graphically view,,related to slam benchmarking java code
FTP Programming in Java tutorials with example code
FTP Programming in Java In this tutorial series of Java programming we are now continuing with the FTP Programming in Java. With the help of these tutorials... Programming in Java: What is FTP (File Transfer Protocol)? What is Anonymous FTP
Java File Programming
Java File Programming articles and example code In this section we will teach you about file programming in your Java applications. Java File Programming... program. Java programming language provides many API for easy file management. Java
Programming with JSP
Programming with JSP  Write a program using jsp that accepts a course code as input and displays the course title the program to which it belongs
Programming with JSP
Programming with JSP  Who will post me the answer
Java Programming
Java Programming  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
ajax programming
Ajax Programming What is Ajax Programming? Asynchronous JavaScript and XML... is based on the HTML, Java Script, CSS, and XML. Why Ajax Programming? When you.... Easy to learn and easy to write technology. Where to Start Ajax Programming
Ajax programming
Ajax programming  Hi, How I can start ajax programming easily? I... concept. What should be my starting point for Ajax programming? Thanks   Hi, If you have prior programming experience in any web development
Programming (general)
Programming (general)  I haven't yet started college/university but I'm interested in studying programming. I wondering if programming is difficult or confusing with all the codes you have to learn? Also how many languages would
code
code  code for android sample program
code
code    how to write this in java
Code
Code  code for connecting c lang to database
programming concept
programming concept  Write a program that allows the user to input a total dollar amount for an online shopping order and computes and outputs the shipping cost based on the following schedule
programming of foxpro
programming of foxpro  hello sir , sir i am use the foxpro . but i know about c . sir how can i learn fox pro . i know about something about foxpro
code for this is
code for this is  a b c d c b a a b c c b a a b b a a a code
socket programming question
socket programming question   can you respond to me the multiple clients chat application java code and a server that manages the clients using the socket programming in java
socket programming question
socket programming question   can you respond to me the multiple clients chat application java code and a server that manages the clients using the socket programming in java
java programming problem - JDBC
java programming problem  Hi, Request you to provide the source code in Java for the following programming problem : upload .csv file data into oracle database. please send the solution to raichallp@yahoo.in
socket programming question
socket programming question   can you respond to me the multiple clients chat application java code and a server that manages the clients using the socket programming in java
code
code  please provide code for custom tags.by using currdate tag we need to get current date?please give me code
code
code   hi I need help in creating a java code that reminds user on a particular date about their festival. i have no clue of how to do it.. am looking forward to seek help from you
 

 

 

DMCA.com