Temperature conversion not working can someone help me.

import java.awt.Graphics; // program uses class Graphics
import javax.swing.JApplet; // program uses class JApplet
import javax.swing.JOptionPane;
public class Temp1 extends JApplet
// draw text on applet's background
public void paint( Graphics g )
// call superclass version of method paint
super.paint( g );
int cels;
for (int fahr = 0; fahr <= 212; fahr++ )
cels = 5.0 / 9.0 * (fahr - 32);
System.out.printf( "%df\n", cels);
g.drawString( "Is then converted to" + cels + "degrees Celsius", 25, 25 );
} // end method paint
} // end class WelcomeApplet
it does give me one error its says possible loss of precision on line 15, the cels = 5.0 / 9.0 * (fahr - 32); line

You're basically doing this:
int i = 1.5;Obviously, you can't put 1.5 into an int, so it will get truncated down to 1. However, the compiler is forcing you to either fix it or tell it that you really want to truncate the double to an int.
double d = 1.5;
OR
int i = (int)1.5;

Similar Messages

  • When i type in the correct answer for my security question it always comes up as incorrect I have the answer written down but there not working can someone help

    hello
    when i type in the correct answer for my security question it always comes up as incorrect I have the answer written down but there not working can someone help

    Hi, Corinneact. 
    Thank you for visiting Apple Support Communities. 
    The usual cause for errors is that the security question responses are case sensitive.  If case sensitivity is not an issue with your answers, see the last step in the attached section of the article below. 
    Navigate to My Apple ID using your web browser.
    Click "Manage your account"
    When prompted, sign in using your Apple ID and password.
    Click Password & Security
    You'll be asked to answer 2 of your 3 security questions before you can make any modifications. If you are unable to remember your answers, you can choose to send an email to your rescue email to reset your security questions.
    Note: The option to send an email to reset your security questions and answers will not be available if a rescue email address is not provided. You will need to contact iTunes Store support in order to do so. 
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Cheers,
    Jason H. 

  • Bluetooth Mouse and keyboard STILL Not working can someone help me?

    i have an apple Bluetooth Keyboard and wireles mighty mouse. Since i have installed leopard months ago it was working fine but then my mouse and keyboard stopped pairing with my Powerbook it recognises the devices but the refuse to pair i changed the batteries and installed the software that cam ith the keyboard and mouse and still nothing works.
    Can someone help me please

    After updating to 10.5.2 I am still experiencing problems with my Apple wireless mouse and keyboard. This is a Leopard issue ( here is just one blog on the topic
    http://aralbalkan.com/1086 ) in 2005 I purchased a Mac Mini which I love and never experienced a Bluetooth problem till I installed Leopard several months ago, now at least once a week, on average 2-3 times a week, I loose connection with the keyboard or the mouse and it takes awhile to re-establish the connection. I was hoping the last upgrade would address this issue but no such luck.

  • I have a iphone 1 but my touchscreem is not working.. i tried everything but he's still not working. can someone help me?

    Hello, i have a iphone 1 and the touchsreem dont work anymore..
    i tried everything but he's still no working only the homebutton..
    what's the last option? can someone help me..
    m.v.g.
    Sam

    http://support.apple.com/kb/TS1827

  • New Vista pc sound blaster will not work can someone help please even with dri

    hi i have a brand new vista machine with athalon 64 duel core x2 5000 (2.6 Ghz 52 k)with 2Gb ram my old pc was xp .8 celleron but mother board blow hense the change
    Anyway can someone pls help i have creative 2 i think it was my brother who put the card from my old pc to this new one i have the instalation disc it says audigy sound blaster made 200 I my self are not very good at tecky stuff i edit video (Home movies) and add sound to them this will not run on vista pc i feel like throwing it in the bin half my software will not work from xp i just get e messege saying windows is shuting the programe and will not work i've try'd downloading the patch for the beta driver on the site that will not work it just crashes windows out and that is it
    can someone tell me what ime doing wrong or do i need to buy a new sound card system or try to wait for a new updated driver from creative
    Also what is vista beta
    i have on my new pc vista home basic 32 bit are these not the same system
    thankyou
    ps this is my first post
    regards
    Simon in U/K

    nevermind, managed to sort it although i have now lost everything, never again will i have a sony phone, pile of junk is probably the nicest term i can think of for them, this happened with mine, and my partners was broken (somehow screen smashed without any assistance) within 2 weeks of having it. samsung all the way!

  • Tracks 17 onward not working can someone help pretty please?

    Created a 32 track composition and recently backed it up to a separate hard drive to make room on my mac, and when I opened it again on Logic Express Track 17 to 32 aren't working.
    The WAVE files are there and when double clicked they work, but not as part of the composition.
    In the mixer the said tracks do not even show the EQ's!
    Can anyone please help me understand how to make logic play the tracks?

    I'm found solution here:
    http://www.cydiaios7.com/back-camera-not-working-after-ios-7-update-solution.htm l
    Solution 4 help me:
    1. Try a different camera app instead of the stock one – download Camera Awesome, free of charge, from the App store
    2. Install and both cameras should work properly.
    Some times camera not work again. Need to restart Camera Awesome, switch front/rear camera and camera work again.
    This appears to be a definite software issue, not hardware, despite the fact that not all devices are fully supported with all the new features in iOS 7.

  • I tried to sync my phone with itunes last night using my fiance's itunes account now my phone turns on you see the apple logo then it shows the itunes hook up then it will shut itself off i have tried the master reset and it will not work can someone help

    i can not seem to figure out why my phone will not turn on i have tried the master reset plugging it into a computer and the wall charger it does not seem to be doing anything can anyone help please

    you have to restore the device via itunes

  • I purchased a itunes card and brought music on my PC now I'm trying to sync to my ipod touch & it's not working can someone help me?

    I purchased a itunes card an downloaded the new itunes version on my PC. I then went to the itunes Store and purchased music. Now I'm trying to sync it onto my ipod touch and it is not working. What am I doing wrong?

    What exactly happens when you place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes?

  • Trying to download itunes and its not working, can someone help plz??

    I am trying to download itunes to my computer, and everything seemed to be loading ok, but then when I get to the terms&conditions and I try to hit agree, nothing happens, it's as if I can not even click it, does anyone have any idea on what i can do? Thanks
    hewlet packard   Windows XP  

    hi April!
    just doublechecking something. is the download hanging at the initial phase of proceedings? or is this happening after the installation has actually pretty much completed?
    if it's at the later stage of proceedings, are you getting a sort of "brief flash of a license screen? or is something else a little different happening?
    love, b

  • I have a 32gb iphone 5 the wifi signal is bad and the time doesnt work can someone help i did everything thats in my hands and its still not working

    I have a 32gb iphone 5 the wifi signal is bad and the time doesnt work can someone help i did everything thats in my hands and its still not working

    Do you experience the same issue on other WiFi networks?
    Do any other iOS devices experience the same issue on your network?
    Make sure you follow all steps provided in the article below:
    iOS: Troubleshooting Wi-Fi networks and connections

  • I recently downloaded iMovie on my iPhone 5 and it is telling me to connect to wifi or use itunes to download iMovie well I have done both and it is still not working can someone please help me?

    I recently downloaded iMovie on my iPhone 5 and it is telling me to connect to wifi or use itunes to download iMovie well I have done both and it is still not working can someone please help me?

    Hi troy157,
    I'm sorry you are having issues with the iMovie app you purchased for your iPhone5.
    The first thing I would suggest is to log out of your iTunes Account on your iPhone, turn the iPhone off and then on again, and see if app finishes downloading/updating.
    Settings > iTunes & App Stores > Tap on your Apple ID account > Tap Sign Out
    If the issues persists, the article below will give you a few more troubleshooting steps:
    iOS: Troubleshooting applications purchased from the App Store
    Try the following steps to resolve your issue, testing the app after each step.
    1. Update your device software
    Update your device to the latest version of iOS.
    2. Check for app updates
    Ensure that your apps are up to date:
    Open the App Store and tap Updates. If updates are available, tap Update All.
    When prompted, enter your iTunes Store account information. App Store will then download and install the application updates.
    Note: Some applications may require a Wi-Fi connection to update.3. Install another app from the App Store
    4. Restart the application
    If the issue affects only a single app, try closing just that app:
    Press the Home button to return to the Home screen.
    Double-tap the Home button to display recent apps.
    Tap and hold the affected app until the red minus appears.
    Tap the red minus to quit the app.
    Press the Home button, then restart the app.
    5. Restart your device
    Hold the Sleep/Wake button until "slide to power off" appears. Slide to power off your device. When it is off, press the Sleep/Wake button to turn it back on.6. Reinstall the affected application
    Remove the application from your device and reinstall it.
    Touch and hold any application icon on the Home Screen until the icons start to wiggle.
    Tap the "x" in the corner of the application you want to delete.
    Tap Delete to remove the application and all of its data from your device.
    Press the Home button.
    Go to the App Store.
    Search for the application and then download it again.
    Note: If it is a paid app, ensure you are using the iTunes account you purchased the app with originally. If it is not, you will be charged for the app again. For more information regarding downloading previously purchased items, see this article.
    I hope this information helps ....
    Have a great day!
    - Judy

  • Number 4 on my wireless keyboard is not working can someone please help

    number 4 on my wireless keyboard is not working can someone please help

    You do know with absolute certainty he, that the mic does not work at all? Have you tried recording a video with sound to test to make sure that the microphone isn't working?
    if you have tried recording a video with sound and that did not work, have you tried any troubleshooting steps at all? Have you looked to see if there is any debris covering the mic? Or do you have a cover that could be interfering with the microphone?
    you can start with a reset of the iPad if you haven't done anything else. Hold down on the sleep and home buttons at the same time, for about 10 seconds, until the Apple logo appears on the screen. When you see the Apple logo on the screen, you can let go of the buttons and let the iPad start up. Try the microphone after the iPad starts up again.
    You could try restoring the iPad to factory settings and see if that recovers the microphone for you.
    Use iTunes to restore your iOS device to factory settings - Apple Support
    It is also possible that you could have a hardware issue which you will not be able to resolve on your own. If you cannot find any other way to get the microphone to work you may end up having to take it to an Apple store and let an Apple genius evaluate the device.

  • I want to set up my videos on my iPad mini by artists, not songs. can someone help me?

    i want to set up my videos on my iPad mini by artists, not songs. can someone help me?

    When requesting assistance, please provide the complete model name and/or product number of the HP computer in question. HP/Compaq makes thousands of models of computers. Without this information it may be difficult or impossible to assist you in resolving your issue.
    The above requested information can be found on the side, back, or bottom of your computer. Please do not include your serial number.
    Also provide the model number of your Bose speakers for our review. If your computer is running Windows 8, you can access to Windows Control Panel by typing "control panel" while on the "Modern" desktop. All of the system settings and information will be available there.
    Please click the white KUDOS star to show your appreciation
    Frank
    {------------ Please click the "White Kudos" Thumbs Up to say THANKS for helping.
    Please click the "Accept As Solution" on my post, if my assistance has solved your issue. ------------V
    This is a user supported forum. I am a volunteer and I don't work for HP.
    HP 15t-j100 (on loan from HP)
    HP 13 Split x2 (on loan from HP)
    HP Slate8 Pro (on loan from HP)
    HP a1632x - Windows 7, 4GB RAM, AMD Radeon HD 6450
    HP p6130y - Windows 7, 8GB RAM, AMD Radeon HD 6450
    HP p6320y - Windows 7, 8GB RAM, NVIDIA GT 240
    HP p7-1026 - Windows 7, 6GB RAM, AMD Radeon HD 6450
    HP p6787c - Windows 7, 8GB RAM, NVIDIA GT 240

  • My iphone 4 is frozen on the slide to unlock screen. ive tried the sleep/awake button home button but it doesnt work can someone help me :)

    my iphone 4 is frozen on the slide to unlock screen. ive tried the sleep/awake button home button but it doesnt work can someone help me

    By the slide to unlock screen, are you talking about the slider at the bottom of the screen after taking out of sleep mode?
    And by trying the sleep/wake button and home button, are you talking about a reboot by holding both the power/sleep button and the home button until the apple logo appears and it reboots?  And that does not help release the issue with the slider?
    Are you sure the iPhone is well charged?
    If none if this helps, have you tried syncing/backing up to a compter and then restore by iTunes on a computer?
    If you cannot do any of this it would be good to schedule a visit to an Apple store genius bar and have the techs try their hand and diagnostics.

  • I am unable to update my apps... in my purchases page it appears as "update", then a message tells me to log on with the Apple ID I purchased the app with... Well I have tried my two different accounts and neither one will work, can someone help ??

    I am unable to update my apps... in my purchases page it appears as "update", then a message tells me to log on with the Apple ID I purchased the app with... Well I have tried my two different accounts and neither one will work, can someone help ??
    And is there any way to sync all my purchases and accounts to just have one... It is a bit stupid that you dont even get a list of something of what account you may of used, or some kind of hint, so you could log on to the right account. I am really stuck ...
    Please Advise......

    You can't merge accounts. But you can check your purchase history:
    iTunes Store & Mac App Store: Seeing your purchase history and order numbers
              http://support.apple.com/kb/HT2727
    Also, what may seem stupid to you... may be a protection of privacy to others.

Maybe you are looking for