Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java

Name: Anonymous 2009-02-18 0:06

I need to convert a user inputted temperature from Celsius to Fahrenheit. this is what I have so far:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
 
    public static void main(String[] args) {
       privateMain(args);
    }

    private static void privateMain(String[] privateArgs) {
        System.out.println("Enter C or F <return>");
        BufferedReader in =
            new BufferedReader(new InputStreamReader(System.in));
        String type = null;
        try {
            type = in.readLine();
        } catch (IOException e) {
           
            e.printStackTrace();
        }
        if (type=);
        {
          //statements 
        }
        else
            //statements
        System.out.println("Converted is: " + temp);

       
    }
}

How do I take the input, read it as  Celsius or Fahrenheit, and convert it with the if statement? And i know I suck at programming, so you don't have to tell me

Name: Anonymous 2009-02-18 20:05

WTF. Don't use fucking string concatenation. Instant fail. Use StringBuilders.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List