Going mad with the basics

I've got a method where I'm passing in an int number (numberOfDays).
I'm then doing the following:
double percentage;
percentage =2/(numberOfDays+1);
but percentage always equals 0.0.
If I do
percentage =2-numberOfDays;
then I get a number.
Am I going crazy or is there a reason for my division not working????

dont get Crazy.
that is java complier known Error.
double percentage =(double)2/(double)(numberOfDays+1);
the idea:
in java u cant say double = 2/ integer.
becuase i will get always 0.0
so u have to convert the integer into double and then get the operation

Similar Messages

  • Stuck with the basics..

    Hi!
    this is not a programming problem, but it seems that i am stuck with the basic , i am trying to implement my custom  PushBufferDataSource and a PushBufferStream, but i am not able to understand that how the      read(Buffer buffer) method and the transferHandler thing work..(i.e. when they are called and by whom)
    i would be thankful if someone can briefly explain me these things..

    There are 2 functions on a processor, setMediaTime (start time) and setStopTime(end time) that you can use to make a processor play only a portion of a file and then stop. So, if you use those to make a processor only play part of a file, you can make the datasink attached to the processor only save a portion of the file. No special implementations needed.
    Take a look at the API, and play around with it.
    http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/apidocs/
    That should be enough to get you going...

  • I can't update the purchases I made with the old Apple I.D. How can I sync my old Apple I.D. with new one?

    I can't update the purchases I made with the old Apple I.D;
    how can I sync my old Apple I.D. with new one?

    Only the Apple ID used to buy an app can update an app. Apple does not merge Apple IDs and Apple does not transfer content biught with one ID to another ID.

  • After doing a Google search, I click on a link and go to the searched web page.  When I go back to the Google page using the back button the links I originally clicked on no longer show as "greyed out".  Any idea what is going on with the browser?

    After doing a Google search, I click on a link and go to the searched web page.  When I go back to the Google page using the back button the links I originally clicked on no longer show as "greyed out".  Any idea what is going on with the browser?

    Type '''about:config''' in the Location (address) bar and press the "Enter" key. When you see a warning, click '''I'll be careful, I promise!''' button.
    * Preferences that have been modified are shown as '''bold (user set)'''.
    * Preferences can be '''Reset to the default''' or changed via the right-click context menu.
    -> In the '''Filter bar''', type '''browser.sessionhistory.max_entries'''
    * Right click the preference '''browser.sessionhistory.max_entries''' and click '''Modify'''
    * Change value from 0 to whatever you want over 0 (Default value is 50)
    * click OK
    -> Close the '''about:config''' tab and then Restart Firefox.
    See this post:
    * https://support.mozilla.com/en-US/questions/860894#answer-229574
    Check and tell if its working.

  • I need to open programs made with the old Appleworks v6. Is there a program i can obtain to open them?

    I need to open programs made with the old Appleworks v6. Is there a program i can obtain to open them?

    Hello Ian Shaw,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    AppleWorks: Document Recovery Techniques
    http://support.apple.com/kb/TA22029?viewlocale=en_US
    Best of luck,
    Mario

  • Is there an issue going on with the iPhones? And iPads? I cannot send text pics.  I can't get on Facebook, and I can't get on anything that uses Facebook ex Slotomania.  This has been going on for a few days!!!  It is happening with and without upgrades.

    Is there an issue going on with the iPhones? And iPads? I cannot send text pics.  I can't get on Facebook, and I can't get on anything that uses Facebook ex Slotomania.  This has been going on for a few days!!!  It is happening with and without upgrades.

    Contact facebook to address the facebook issues.

  • Camera-raw plugin for NEF files, made with the new Nikon D7200

    Hi, does anyone know when there will be a camera-raw plugin for NEF files made with the new Nikon D7200?

    I think that camera is too new. Even the DNG converter will not support it. If you have Nikon software with the camera, you could convert to tiff and then use the tiff files in Elements whilst awaiting the next Camera Raw update for PSE13.

  • Problems with the basics

    Hi, I recently purchased a copy of Photoshop so that I could creat custom artworks for a few of my new websites:
    <links removed>
    Unfortunately I'm not very good at using this software, so can anyone suggest a good basics guide to use for this software as i'm just getting confused by the help files that come with it.
    Cheers
    John A

    You have a lot of company.  The learning curve for photoshop is quite steep, but the program has huge potential.
    The Adobe Classroom in a Book is good to start with the basics and move forward.  Adobe also sends out a DVD with numerous tutorial on in.
    Another book that is good is Adobe Photoshop by Martin Evening.
    There are also many free tutorials on Adobes' website and and the web.
    If you really want to learn the nuts and bolts with video tutorials Lynda.com is probably the best.  It is a paid service, but you can view as many tutorials as you want while subscirbed.  So if you subscribe pick a month where you have extra time to spend learning.
    Hope this helps, and good luck.
    Welcome to the photoshop community.

  • What is going on with the scroll function? It doesn't seem to work in any applications, now that I downloaded the new Mountain Lion?

    What is going on with the scroll function. It doesn't seem to work ever since I downloaded Mountain Lion.

    I've noticed this too...when I'm in Safari, scrolling is a bit jerky and sometimes it stops even though I'm still scrolling...my fingers go right off the trackpad.  I just downloaded the new updates onto my brand new macbook air- had to do it manually as "power nap" doesn't work, even after the SMC reset.  Lamesauce.

  • What is going on with the Iphone4 home button.  I see lots of people having issues, but not resolution.  I am running 4.2, but based on what I have read, 4.3 does not help.  Apple has to do something about this, as it is affecting lots of people.

    What is going on with the Iphone4 home button locking up?  I see lots of people having issues with the button becoming unresponsive, but no resolution.
    Suggestions include:
    Upgrade
    Restrore
    ReSync
    Push harder,
    etc. 
    I am running 4.2, but based on what I have read, 4.3 does not help.  Apple has to do something about this, as it is affecting a large portion of the user community.

    lfossier1 wrote:
     Apple has to do something about this, as it is affecting a large portion of the user community.
    No they do not and no it is not affecting a large portion of the user community.
    If it is an actual hardware issue, the only fix is to repair or replace the hardware.
    If it is a software issue, restoring as new will fix it.

  • HT1688 I just tried to install the latest software update for an iPhone 5, and now the phone is stuck in recovery mode.  Are there any options available to avoid going through with the recovery.  This seems really lame.

    I just tried to install the latest software update for an iPhone 5, and now the phone is stuck in recovery mode.  Are there any options available to avoid going through with the recovery.  This seems really lame.

    No.
    You must restore.

  • I don't know what is going on with the White Balance (WB) and LR.  I had no problem before but recently LR started to change the  WB as  it is importing photos.  I checked the color scale for my photos and LR and both are with sRGB.  Now instead of LR cha

    I don't know what is going on with the White Balance (WB) and LR.  I had no problem before but recently LR started to change the  WB as  it is importing photos.  I checked the color scale for my photos and LR and both are with sRGB.  Now instead of LR changing the WB it is giving me a second copy with a new WB.  Your advise is very much needed and appreciated.  Thank you.

    Can you show us a screen capture of this 2nd copy with a new WB in your Lightroom grid? Thanks
    Are these second copy photos by any chance photos that had been previously imported?

  • What is going on with the SPAM filtering?

    Spoiler (Highlight to read)
    What is going on with the SPAM filtering?  Works fine for a couple of weeks then suddenly I got slammed with tons of SPAM for a few hours then suddenly the filtering kicks in again.  Usually happens late at night and clears up in the morning.  Never had this problem until just a couple months ago.  It's gotten so bad that I'm about to move everything over to gmail and just stop using Verizon, would rather not do that as I've had the same e-mail address since the Bell Atlantic days.

    Since we haven't heard back from you or have received a form submission as requested in your private support case, it appears assistance is no longer required. If you need any future help with your Verizon service, please make a post here on the forums so we can assist..
    Anthony_VZ
    **If someones post has helped you, please acknowledge their assistance by clicking the red thumbs up button to give them Kudos. If you are the original poster and any response gave you your answer, please mark the post that had the answer as the solution**
    Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or plan

  • What is going on with the quick keys in CC? Illustrator, InDesign and Photoshop?

    What is going on with the quick keys in CC? Illustrator, InDesign and Photoshop? The delete key only works when it wants to as well? We (Co-Workers) all use our shortcut keys A LOT and these will sometimes work and sometimes don't work. It only started when we downloaded the new CC. What's going on??

    The Arial Font works on the MacBook Pro, but it is not listed on the iMac.
    By not listed, do you mean it doesn't show up in the font lists of apps you're using, or it literally isn't on the hard drive?
    Look in the /Library/Fonts/ folder. That's the Library from the root of the drive, not in the System folder or your user account. Is Arial.ttf actually missing?

  • WHAT IS GOING ON WITH THE LASTEST MAY UPDATE??

    WHAT IS GOING ON WITH THE LATEST UPDATE??  Ever since the May update for the Samsung Note 3 I've been having issues with my phone!  Battery charge does not hold, it charges slow and then drains VERY fast.  I can't even make it through the day without charging. Today it went from 100% to 37% in a few hours just sitting on my desk!  Also, having camera issues,  I snap a picture and it takes so long to process that it doesn't take the picture I was aiming at but a blurred image of the area around my focal point!  Also, since the update I keep getting the message "touch wiz has stopped" when I press the navi key.  Are this issues being corrected?  Is Samsung or Verizon fixing these issues.  When will the next update come out?  The only suggestion I'm hearing is to reset the phone, but I'd lose settings, apps, etc. That is NOT a solution!!  I'm very frustrated, and angry.  This phone is way too expensive to have to deal with these issues!

    Duplicate Post See: Re: KitKat Update Issues
    <<Moderator Note: Please link to posted answers instead of making several identical posts.>>
    Message edited by: Admin Moderator

Maybe you are looking for

  • Manual Data binding with ADF table?

    Hi, I am making a stored procedure call for fetching data from database on the click of action button. My query has a where clause in it. I am not able to bind my adf table manually with my data control. Can anyone provide me some link for binding my

  • How to create Quotation from Ad hoc cost estimation of cProjects?

    Hi Guruu2019s Please help me in resolving the issue given below. I am able to get ad hoc cost estimation results in accounting screen, but not able to create a Quotation from Ad hoc cost estimation of cProjects. I am here with providing necessary ste

  • BPC 7.0 drill down missing values

    Hi, in our reports when we drill down trought a dimension, we have missing rows. For exemple: LEVEL 1 - TOTAL 100 LEVEL 2A - TOTAL 80 LEVEL 2B - TOTAL 5 we have LEVEL 2C missing with TOTAL 15 the reason seems to be that there is another dimension nam

  • Need help with report generation toolkit

    I'm having a really hard time finding a solution for my problem. I'm measuring a distance and a diameter simultaneously. The outcoming values have a depency and are stored in a 2-D array.  I want to export this array to an excel table and x-y-chart (

  • Need option to remove/delete local contacts

    I have duplicate contacts (probably ~1000) because somehow my Z10 has duplicated my ActiveSync contacts as 'local' contacts. I've wiped and reloaded to make sure it wasn't something I did - and I had only one of each contact for about a day. Yes, man