Farenheit to Celsius...

Hello!
I am trying to make a program that translats Farenheit to Celsius....
BTW, is the textio.java invluden in java.awt ?
Thanks in advance.
Klas
import java.lang.Math;
import java.awt.*;
public class Uppg2_4{
     public static void main(String args[])
          double C;
          double F;
          System.out.print("F?:");
F = TextIO.getdouble();
          C = ((5/9) * (F-32));
          System.out.println(C);
Error msg:
E:\Program\Xinox Software\JCreator LE\MyProjects\uppg2\Uppg2_4.java:13: cannot resolve symbol
symbol : variable TextIO
location: class Uppg2_4
F = TextIO.getdouble();

Hello again!
Rookie programmer, yes I am....*lol*
Anyway, I am almost finished now, but it always gives me the answer "0.0" Celsius whatever Farenheit I do putin, in the inbox. ;-(
Thanks in advance again.
Klas
import java.awt.*;
import javax.swing.*;
public class Uppg2_4{
     public static void main(String args[])
          double C;
     String inmatning1;
     double intal1;
     inmatning1=JOptionPane.showInputDialog("F:");
     intal1 = Integer.parseInt(inmatning1);
          C = ((5/9) * (intal1-32));
          C = Math.round(2 );
          System.out.println(C);

Similar Messages

  • What Language Should I Choose?

    I live in Australia, but when I choose what language I want to use which one do I choose?
    English (UK)
    Or
    English (US)

    I believe the main difference, beyond some extra (or missing) vowels is if you want temps in farenheit or celsius
    Choose the one that works for you.
    You can always change it later.

  • What should power supply temperature be?

    I have major fan issues with my mac pro. It is super loud all my temperature readings seem pretty good ranging from 25-35 degrees, except for power supply. It has temperature of 62 (location 1) and 58 (location 2).
    Is that normal or does that seem high?

    I don't know if there's a 'right' temperature and there are a lot of variables.
    My Mac Pro (less than a year old) is typically always on, and my power supply comes in (currently) at around 113 degrees farenheit (45 celsius), as I kick back and surf the web.  It's quite a few degrees hotter when I'm putting the machine to serious work, converting or rendering video or audio files.
    Depending on the work you're doing, the age of the machine (the older a system is, the more likely dust will have accumulated, causing it to run hotter), the environment (smokers, pets, etc, all contribute to dust accumulation), you could easily see temperatures that high or even higher.
    Dust is probably your machine's worst enemy, those micro-fine particles settle on the components and act as an insulator, over enough time they can cause components to fail.  For a bit of light maintenance, power the machine off, open it up, and use a can of compressed air to blow as much dust out of your system as possible (you may be surprised how much can accumulate in there). 
    Hope that info helps!

  • Need help with calling method

    I'm new to Java, trying to pass a required class so I can graduate this semester, and I need help figuring out what is wrong with the code below. My assignment is to create a program to convert celsius to fahrenheit and vice versa using Scanner for input. The program must contain 3 methods - main, convert F to C, method, and convert C to F method. Requirements of the conversion methods are one parameter which is an int representing temp, return an int representing calculated temp after doing appropriate calculation, should not display info to user, and should not take in info from user.
    The main method is required to ask the user to input a 1 for converting F to C, 2 for C to F, and 3 to end the program. It must include a while loop that loops until the user enters a 3, ask the user to enter a temp, call the appropriate method to do the conversion, and display the results. I'm having trouble calling the conversion methods and keep getting the following 2 compiler errors:
    cannot find symbol
    symbol : method farenheitToCelsius(int)
    location: class WondaPavoneTempConverter
    int celsius = farenheitToCelsius(intTemp);
    ^
    cannot find symbol
    symbol : method celsiusToFarenheit(int)
    location: class WondaPavoneTempConverter
    int farenheit = celsiusToFarenheit(intTemp);
    The code is as follows:
    public static void main(String[] args) {
    // Create a scanner
    Scanner scanner = new Scanner(System.in);
    // Prompt the user to enter a temperature
    System.out.println("Enter the temperature you wish to convert as a whole number: ");
    int intTemp = scanner.nextInt();
    System.out.println("You entered " + intTemp + " degrees.");
    // Prompt the user to enter "1" to convert to Celsius, "2" to convert to
    // Farenheit, or "3" to exit the program
    System.out.println("Enter 1 to convert to Celsius, 2 to convert to Farenheit, or 3 to exit.");
    int intConvert = scanner.nextInt();
    // Convert temperature to Celsius or Farenheit
    int celsius = farenheitToCelsius(intTemp);
    int farenheit = celsiusToFarenheit(intTemp);
    while (intConvert >= 0) {
    // Convert to Celsius
    if (intConvert == 1) {
    System.out.println("Celsius is " + celsius + " degrees.");
    // Convert to Farenheit
    else if (intConvert == 2) {
    System.out.println("Farenheit is " + farenheit + " degrees.");
    // Exit program
    else if (intConvert == 3) {
    break;
    else {
    System.out.println("The number you entered is invalid. Please enter 1, 2, or 3.");
    //Method to convert Celsius to Farenheit
    public static int celsiusToFahrenheit(int cTemp) {
    return (9 / 5) * (cTemp + 32);
    //Method to convert Farenheit to Celsius
    public static int fahrenheitToCelsius(int fTemp) {
    return (5 / 9) * (fTemp - 32);
    I readily admit I'm a complete dunce when it comes to programming - digital media is my area of expertise. Can anyone point me in the right direction? This assignment is due very soon. Thanks.

    1) consider using a boolean variable in the while statement and converting it to true if the input is good.
    while (inputNotValid)
    }2) put the code to get the input within the while loop. Try your code right now and enter the number 30 when your menu requests for input and you'll see the infinite loop.... and why you need to request input within the loop.
    3) Fix your equations. You are gonig to have to do some double calcs, even if you convert it back to int for the method return. Otherwise the results are just plain wrong. As a good test, put in the numbers -40, 0, 32, 100, and 212. Are the results as expected? (-40 is the only temp that is the same for both cent and fahr). I recommend doing double calcs and then casting the result to int in the return. for example:
    int a = (int) (20 + 42.0 / 3);  // the 42.0 forces the compiler to do double calc.4) One of your equations may still be plain wrong even with this fix. Again, run the test numbers and see.
    5) Also, when posting your code, please use code tags so that your code will be well-formatted and readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:
    [code]
      // your code block goes here.
    [/code]

  • Working at 80 celsius (172 degrees Farenheit)

    Hi! I'm running a program that keep my MB temperature over 80 Celsius and 6000 rpm and keep it all the time (24 hours@day) My question is, it could damage my MB?
    Thanks!
    Andres N.

    i don't know what the limitations are, but i would simply recommend limiting the program's processor allowance. mine shut down when the program was non-stop using 200% processor power for about 3 hours. hope that helps.

  • Celsius to Farenheit and viceversa

    Hello everyone, I hope someone can help me with a project I am working on.
    I need to do a simple VI that converts from degrees C to degrees F and viceversa. In the front panel, the user should be able to convert from one to the other. For example, if there are 2 thermometers and the user slides the Celsius degrees down to 0, the other thermometer should move to 32 degrees. However, the user should ALSO be able to go the opposite direction while the VI is running. In other words, the user should be able to change the temperature in EITHER thermometer and the OTHER should change accordingly. I am only able to go ONE direction because I think I should be able to have some sort of control that also works as an indicator. Please let me know if there is a way to do this!!! THANKS.

    You can also use "units" for each control (degF and degC, resp.), no more conversion math needed.
    Message Edited by altenbach on 02-18-2007 07:51 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    DualT.vi ‏14 KB
    DualT.png ‏6 KB

  • How do I get the weather on my iPad running iOS7 to show celsius in the Notification Center?

    I just upgraded my iPad to iOS 7 and noticed in the notification center, the weather is in farenheit.  I prefer celsius.  Any thoughts on how I can change that?

    Demo wrote:
    hangtenn wrote:
    yes this is much easier to do on the iphone as it's just a switch in the pre-existing weather app, while leaving the region format unchanged.  unfortunately, the ipad has no such pre-existing app, and the notification center will not take it's cue from any weather app you download. 
    The reason that I explained the solution the way that I did, is because there is NO weather app on the iPad and the only way that I can see to change this would be to change the region format.
    Besides, I based my answer on the assumption that the region format was set incorrectly on Brian's iPad.
    sorry for the confusion, that response was meant to defend your solution to iamcem (i should have quoted their response when i posted mine).  they were saying that changing the region was a bad idea, and that the change should be made in the default weather app.  i was explaining to them that although their's was a simple solution, it only worked on the iphone.  i was trying to explain why their solution wouldn't work on the ipad, and so why your solution was the best available.

  • MSI GeForce GTX 560Ti "Twin Frozr II" crash at 50 degrees Celsius

    I get artifacts (pink squares all over screen) in heaven benchmark, fluid benchmark and gta 4,  a few seconds  later I get a black screen and then an error message there windows tell me the driver has crash but praise msi it was successfully recovered. All this then the card is nearing 50 degrees Celsius.
    I have:
    MSI GeForce GTX 560Ti "Twin Frozr II", (BIOS: 70.24.0a.00.00)
    Gigabyte GA-890GPA-UD3H, Socket-AM3
    AMD Phenom II X4 965 Black Edition
    Corsair Powersupply 650W Black,ATX/EPS
    Corsair XMS3 DDR3 1600MHz 4GB CL9
    Windows 7 64bit (with sp1)
    DC OUTPUT    +3.3V +5V  +12V -12V  +5Vsb
    MAX LOAD    24A    30A  52A   0.8A   3A
    I tested driver on msi site and the latest nvidia driver, even tested some beta driver. All give the same result as stated above. I also tested to set the clocks at reference speed but no go. Also tested voltage at 1025.

    Got a new card today, same card but new.
    No problems now, seem the new card has newer bios and lower  core voltage. Maybe that is a way to fix it, just upgrade bios.

  • Calendar weather units always revert to celsius

    I switched the calendar app's weather units to fahrenheit, but it always changes back to celsius. I've tried clearing app data and re-setting the units, but after a while (or immediately after swiping the app out of the task manager), it goes right back to using celsius.
    How do I make the app stick to using fahrenheit?
    App version is 15.0.A.1.14

    What if you clear the data on the calendar 
    settings > apps > all > calendar > clear data 
    "I'd rather be hated for who I am, than loved for who I am not." Kurt Cobain (1967-1994)

  • How do I change the 'weather' button to give Australian temp in celsius, and pressure in kPa?

    There is a weather button in one of the toolbars. It gives readings in the US units. How do I change it to the mksa (or European) system. i.e. Celsius not Fahrenheit, etc.

    That's not a standard feature in Firefox. It was probably added by an extension you installed. Visit the https://Addons.Mozilla.org page where you downloaded that extension from, and look at the '''''More about this add-on...''''' or visit the developer's website for instructions for using and configuring that extension.

  • How do you change the weather temperature from Celsius to fahrenheit?

    Hi my name is Paul, gotta say that the "iPad Mini" is one of the best apple device's in the history of apple. But theres something now working right.. Every time i ask siri something about the weather temperature, siri tells me in "Celsius not Fahrenheit". I'd tryed everything to change it and i really dont how to! Somenone please help me out here! 

    Yeahh you are right about ipad mini being the best device from apple ! Hmmm
    Go to CLOCK APP IN UR IPAD MINI, thn tap world clock and up above in left tap edit here u will find F* and C* select the one u want n u r done !!!

  • How do you change the weather from Fahrenheit to Celsius in iPhoto for iOS?

    I have been trying to change the weather from fahrenheit to celsius and I cannot seem to find out how. Can anyone help?

    I had the same thing happening after upgrading to IOS 7.
    I clicked on the weather notification which opened a new tab
    https://www.dropbox.com/s/sai5kn3xufrqngd/IMG_0013.PNG
    I just had to click on the °C to get the Celsius displayed both in the app and the notification.
    Maybe a reboot would help ?

  • Buongiorno, ho acquistato un macbook pro 13 retina fine 2013, e giocando a touchgrind, che richiede poco a livello hardware, il processore raggiunge subito i 90-95 gradi celsius,è normale? che succederebbe giocando a un gioco più pesante (borderlands 2)?

    Buongiorno, ho acquistato un macbook pro 13 retina fine 2013, e giocando a touchgrind, che richiede poco a livello hardware, il processore raggiunge subito i 90-95 gradi celsius, è normale? Essendo touchgrind 'leggero', quanto si riscalderebbe il processore con un gioco come borderlands 2, che si può considerare 'pesante'? grazie in anticipo

    Games can be very CPU/GPU intensive and temperatures in the 90°c range are not uncommon.  Note that there are thermal shutdown provisions in the Macbook Pro that will turn the computer off before damage from heat will harm it. 
    If possible, play games on it in environments are cool and consider a cooling pad if you wish to play games often.
    Ciao.

  • Weather App in iTouch now shows temps in Celsius

    I restored my iTouch now the weather app shows the temps in Celsius! How do I get it back to fahrenheit? I checked the help topics, for iPods, apple menus, and the discussion groups. I looked in preferences, and anything else that I could think of.
    I'm stumped. Any ideas?

    http://manuals.info.apple.com/enUS/iPod_touch_3.1_UserGuide.pdf

  • IMac i7's Hard Drive is 56 Degrees Celsius?

    Hi. The newscast report it's around 32 degrees celsius. The iMac i7's hard drive using SMARTReporter says the hard drive is at 56 degrees celsius with just Safari and Mail launched. Will the hard drive be damages (and the iMac itself). It's not really hot, it's a cloudy day. I have a western digital Firewire Time Machine backup. The iMac was bought last March 2010 only, 4 months ago. Nothing's blocking the ventilation. Would this iMac be ok?Please advise. Thanks in advance.
    Gbu.

    That's very hot, and I don't know if your fans are ramping up or not. My guess is probably not; I have no idea how hot things have to get before the fans get off their minimums. I noticed my drive was getting up to 51C and the HD fan was still running at its slowest. You can install a little fan program which will allow you to set minimum fan rpms. I have 3 different settings in increments up to around 2K for when things get really hot.
    In very hot weather I allow the computer to sleep and cool off more often.
    SMCFan Control
    http://www.eidac.de/
    For ten bucks you can also install Hardware Monitor, which will give you readouts of mostly everything, including the fan rpms. It is very accurate.
    http://www.bresink.com/osx/HardwareMonitor.html
    Message was edited by: WZZZ

Maybe you are looking for