Help! Why are my outputs zero?

Any reason why when I run this program all of the inputted numbers become zero instead of their values?
Cheers
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class Statistics1
     static BufferedReader b;
     public static void main(String[]args)
     throws java.io.IOException
          //Define variables
          StringTokenizer st=new StringTokenizer(" ");
          b=new BufferedReader(new InputStreamReader(System.in));
          double input_number[]; //creates array called input_number which will be a double
          input_number=new double[5]; //5 elements in array
          String str; //5 numbers inputted by user
          //This part of the program takes the five inputs from the user and converts them into an integer and puts into array.
          System.out.println("Input 5 numbers and press [Enter]");
          str=b.readLine();
          int cnt=0;
          while(st.hasMoreTokens()&&cnt<input_number.length)
          {input_number[cnt]=Integer.parseInt(st.nextToken());}
          //blah blah rest of code......     

1) You are reading the numbers from the hard coded string " " and not the user input.
2) You never modify the value of the variable "cnt".

Similar Messages

  • *HELP* why are "edit in photoshop" images smaller?

    Ok, for the life of me (I've searched this forum high and low and can't find an answer) I cannot figure out why when I go to "edit in phototshop" my images end up being around 7x13 instead of full size. I always import the images in full resolution (from my Canon 5D).
    Of course I can select the entire catalog and "export" and change the size to whatever I want to but I'm afraid when I'm opening them up in CS5 from LR3 that I'm losing image quality.
    So I guess I have 2 questions:
    Is there an adjustment that will allow me to "edit in" in FULL file size in CS5?
    If not and I save the files in CS5, then I see them edited in my LR catalog and I go to export them and make the image size larger (say 20x30 from the 9x13) that it opened up as in CS5, is there IQ loss?
    Hope that made sense.
    Any help is appreciated!

    You are not the only person who has been confused by this.
    For digital images, the resolution in pixels per inch, or pixels per centimeter, are truly meaningless. They do not affect the exported photo in any way. The same is true for the Edit In ... dialog box. The result of an "Edit In ..." is always a digital file.
    If you are exporting with the goal of printing an image, then you could set the units to inches, and select pixels per inch, and for example, if you wanted to print a 4x6, you could set the long edge in the Export dialog box to 6 inches and the resolution to 300 pixels per inch, and voila you get an image that has 1800 pixels on its long edge, this downsamples the image, and may not be strictly necessary if your image is actually larger than you need.
    A "Better" way to think about this is the following example — my image is going to be printed at 8x10 inches, I want it to print at 300 pixels per inch, therefore I multiply 8x10 time 300 and discover that I need 2400x3000 pixels (or more!) in order to print properly.
    So with the above explanation, I still have no idea why Edit In ... contains a resolution box, as you can always change the final size in your auxiliary editor. Having a resolution field in the Export Dialog box might make some sense in printing situations.

  • Please Help - why are pics not in focus and sharp?

    I have a 24-70mm f/2.8L lens and am finding that it is not as sharp as i'd expect.  I'm sure it's me and not the lens so hoping someone can help me understand what i'm doing or not doing correctly.
    I'm attaching a picture as an example...hand held...here are the settings:
    EF24-70mm f/2.8L II USM
    59.0mm
    1/640 sec;   f/2.8;   ISO 400
    Shutter priority;   Spot metering
    shot with 70D
    when you zoom into the tree it is cleary not in focus/sharp ;(
    I've tried at differen shutter speeds but still having the same issue... going to try different apertures next...
    Body: Canon 6D, Canon T1i, Canon Elan II,
    Glass: Canon 24-70mm f/2.8L II USM, Canon 18-55 kit lens, Sigma 70-300mm f4-5.6, Canon 50mm f/1.8,
    Flash: Canon Speedlite 430ex ii

    next considered a pic with text to really see what's up cropped image to post... this was taken 10feet away from the text - text is on a piece of paper that is 4x4... outside since that is the best light right now - overcast and about an hour before sun set.... shot in M, set the shutter speed an aperture, and use Auto for ISO.  I usually only shoot in Tv or Av so maybe this wasn't a good test for how i use it but wanted to see what would happen...
    settings:
    EF24-70mm f/2.8L II USM
    67.0 mm
    1/200 sec;   f/2.8;   ISO 250
    anual;   Spot metering
    center AF
    Body: Canon 6D, Canon T1i, Canon Elan II,
    Glass: Canon 24-70mm f/2.8L II USM, Canon 18-55 kit lens, Sigma 70-300mm f4-5.6, Canon 50mm f/1.8,
    Flash: Canon Speedlite 430ex ii

  • Why are input-output lights flashing when not in use? Pirated signal?

    I have my airport base station set up to not make itself public (ie. you must type the name of the network and password for it to appear and let you in). However, I noticed the other morning when I got up (in the dark!) that the lights were flashing like crazy. It really looks like it is in use. Is there anyway to minitor whether or not somebody is stealing signal from me, or is there another explanation?
    Thanks!

    I also can state that it is absolutely normal behavior and nothing to worry about (there is always some network traffic).
    Regarding security, if you really think that could be an issue, you should allow only devices their MAC addresses have been registered to the AirPort to get access.
    This does not take effect to encryption, but prevents unauthorized people (e.g. your neighbor) to share your WLAN network - regardless if they know your password or not.
    Settings are done at the AirPort maintenance software: Select the station, click on "configure", on new window select the tab "Access" and then add the MAC addresses of all devices that are allowed being connected.
    (Note that I use the German version of the AirPort maintenance software, so I'm not sure if I named it correctly).
    MAC addresses are located on all network cards or their packaging, bottom of notebooks (if they have a (W)LAN adapter; remove battery in case you can't find it, sometimes it is hidden there) or somewhere at the back panel of your desktop computer with integrated (W)LAN adapter.
    Just to explain: MAC addresses are unique to each device, they should never appear twice in the World; therefore this is a very safe solution.
    And if you not care much about encryption, you can turn it off completely and profit from faster network access (but this is at your own risk).

  • HT202549 help why are all messages vanishing as soon as I clink on a number to see or send text to

    Recently when I open messaged on my Mac and click on a number to see the conversation or text them the whole conversation vanishes. How do I fix this??

    Generally I would not use Facebook for sharing any photos, it compresses the photos substantially, and when you have shadows and dark colours you get visible "bands" where there should be subtle gradients, ie at sunsets and sunrises.
    It sounds like you are using two methods to upload to Facebook:
    1. Sharing from within Aperture, which basically syncs Facebook with your Aperture album, so any changes made at either end gets synced, hence the deletions from Albums, although the original file should still be in your library, just removed rom the album. It is like a playlist in iTunes.
    2. Exporting pics and uploading to Facebook from the browser.
    I am not sure how method 1 gets compressed, but I know that uploading hi-res jpegs to Facebook using method 2 results in poor quality images.
    I wouldn't even bother comparing option 1 or 2, and they will both be poor images once you view them on Facebook, as opposed to viewing uploaded images on proper image sharing / hosting sites.
    Your problem is not with Aperture, it is using Facebook for showing your work.
    If you export pics form Aperture at high res jpegs or TIFFs your images will be fine.
    If you insist to use Facebook as your way to share your work, then your workflow should be this:
    1. Right click images you want to share.
    2. Select Export version.
    3. Export as 100% size and ensure the export settings are set at 100% quality.
    4. Upload this pic into Facebook.
    This will get you the best image size and resolution on Facebook.
    See how you go.

  • Why are some (but not all) of my Muse slideshow widget images rotated differently than when I edited them in Photoshop CC?

    I have a few dozen photographs embedded in the slideshow widget. Most of them appear exactly as I edited them in Photoshop, but several appear rotated clockwise 90 or 180 degrees. Does anyone know why this is happening, and ideally, how I can correct this problem? Thank you.

    Please share the site url , also refer to this post and check if this helps :
    Why are some of my images importing upside down?
    Secondly , if you change the fill type then does that makes difference ?
    Thanks,
    Sanjit

  • Why are iTunes, View, Window, and Help menu items disabled?

    I am frequently encountering an issue in iTunes 10.5 (141) where all the menu items in the iTunes, View, Window, and Help menus are disabled (greyed out). Why is this happening and can it be stopped?
    I've seen this issue on different Mac OS X 10.7.2 machines. It seems to occur during playlist manipulation, where I'm making new playlists, adding items to them and editing them and the items. In the worst cases, I'm forced to quit and restart iTunes, although I have to quit by using the context menu option in the Dock as the Quit option is disabled in the application.
    I'd appreciate any advice on workarounds for this that don't involve quitting and restarting iTunes.

    I'm also having the same issue.  It was happening with 10.5.1 and now still with 10.5.2.  I'm using a 2008 iMac running 10.6.8.  I do not use iTunes Match.  This seems to happen for no apparent reason i/o/w, I can't determine a pattern as to when it happens, but it occurs about once in every 10 times that iTunes is open and it seems to happen after it's been open for a while, but again, no particular pattern. 
    Sometimes, all the menu items are grayed out, and other times, 70% of the menu items are grayed out.  I can still use the other functionality in iTunes, but must must Quit from the dock (it quits gracefully and no Force Quit is necessary).  Relaunching restores eveything to normal for about a week. 
    I work with technical diagnostic issues and can usually pinpoint a problem, isolate an issue, or determine a pattern, but this one has me stumped. I thought 10.5.2 might fix it, but no.  Maybe 10.5.3?

  • Can anybody out there help shed some light on why no audio output using varispeed tempo only

    Can anybody out there help shed some light on why no audio output using varispeed tempo only?
    I am using Logic Pro 9 and finding no problems using the tempo and pitch option but when I just want to vari the tempo only I loose all output.
    This includes no audio meter activity on channells.

    Another worthwhile time/pitch related product is from Prosoniq. The version of Nuendo (not the latest) the University uses ships with the MPEX algorithm, which is related to to their flagship product.
    http://www.prosoniq.com/www/TimeFactory_II.html
    I've used it a bit to create the double-time/+1 octave  Les Paul & Mary Ford guitar sound for a class demo demo and thought it did a very good job.
    Yes, there is a Demo.

  • Why are some of my still images (jpeg) Ok in my timeline, but skewed ofter output?

    why are some of my still images (jpeg) Ok in my timeline, but skewed ofter output?

    Skewed? Left or right? Could you post a screenshot? What format is your timeline? What is the frame size of the JPEG?

  • Why are songs/albums deleted off of the iTunes store? How can I get them back on the iTunes store? PLEASE help. Thank you.

    Why are songs/albums deleted off of the iTunes store? How can I get them back on the iTunes store? PLEASE help. Thank you.

    Perhaps the copyright holders chose to remove them. What album were you after?
    tt2

  • Why are my contacts and reminders and photos syncing between me and my boyfriends phone, as well as my macbook air? How do I make this stop? I've already deleted Icloud backups on itunes but that didn't help because we still seem to be synced. Help.

    Why are all of my devices syncing with my boyfriends phone? His phones photos are synced to my macbook air photo stream, my reminders are synced to his phone, I already erased all of my itunes backups through itunes thinking that would fix the issue but it failed to resolve the problem. My contacts also synced to his phone and his Imessages are synced to my imessages now... this is extremely frustrating and would like this to stop alread. Please help.

    Well in the iPhone and the iPad in the Settings in the iCloud section, there is an Apple ID associated with the device. And in the MacBook Air there is (or can be) an Apple ID associated with the account.
    In the iPhone and iPad in the same settings panel you select what gets synced with the cloud.
    I'm guessing that your devices and your boyfriend's are set up with the same Apple ID and the switches to sync are set? I'm not an expert but that is what I'd look at first. You need to have a separate Apple ID from your boyfriend or turn syncing off if you don't want that to happen I think.

  • Why are my contacts and calendars showing up on my daughter's iphone after I updated?  Help!

    Why are my contacts and calendar showing up on my daughter's iphone after I updated?  Is there anyway to remove them or stop
    them from going directly to her phone?  Help!!!!  Thanks guys 

    So, am I to conclude from all this that the best thing for one iMac and multiple family devices (2 x iphones, 1 x itouch, 2 x ipods) is to set up itunes account for each family member.  We don't use iCloud except for my (primary iphone)
    We had similar problems to the above, and since the recent 6.0.1 update we've started getting each others texts, on top of my wife and I's contacts being replicated to our young son's itouch, and a seemingly random redistribution of apps. 
    timmyd

  • Why are my pinned top sites disappearing from the top sites page in Mavericks, after they have been pinned? Very appreciative of any help. This is making me crazy.

    Why are my pinned top sites disappearing from the top sites page in Mavericks, after being pinned? Any help would be greatly appreciated.

    Why are my pinned top sites disappearing from the top sites page in Mavericks, after being pinned? Any help would be greatly appreciated.

  • Why are iCals help windows empty?  Topics are listed in a pulldown menu, but the help page that pops up is blank.

    Why are iCal's help windows empty?  Topics are listed in a pulldown menu, but the help page that pops up is blank.

    It could be the work of one of your add-ons, or even add / mal-ware.
    Look thru your add-ons list and make sure you know what each one is
    there for. Also,
    check the programs that are on your computer
    '''''Windows > Start > Control Panel > Uninstall Programs.'''''
    Go thru the list and use a web search to check any that you don't
    know what they are.<BR><BR>
    '''''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-caused-malware Troubleshoot Firefox Issues Caused By Malware]'''''

  • Hi why are my photos after downloading twice ,once in photo library and once in a file with the date why cant i delete a file its an iphone 4s please help

    why are my photos after downloadon twice one as photo library the other as a file with date how can i delete one file same pics

    Generally I would not use Facebook for sharing any photos, it compresses the photos substantially, and when you have shadows and dark colours you get visible "bands" where there should be subtle gradients, ie at sunsets and sunrises.
    It sounds like you are using two methods to upload to Facebook:
    1. Sharing from within Aperture, which basically syncs Facebook with your Aperture album, so any changes made at either end gets synced, hence the deletions from Albums, although the original file should still be in your library, just removed rom the album. It is like a playlist in iTunes.
    2. Exporting pics and uploading to Facebook from the browser.
    I am not sure how method 1 gets compressed, but I know that uploading hi-res jpegs to Facebook using method 2 results in poor quality images.
    I wouldn't even bother comparing option 1 or 2, and they will both be poor images once you view them on Facebook, as opposed to viewing uploaded images on proper image sharing / hosting sites.
    Your problem is not with Aperture, it is using Facebook for showing your work.
    If you export pics form Aperture at high res jpegs or TIFFs your images will be fine.
    If you insist to use Facebook as your way to share your work, then your workflow should be this:
    1. Right click images you want to share.
    2. Select Export version.
    3. Export as 100% size and ensure the export settings are set at 100% quality.
    4. Upload this pic into Facebook.
    This will get you the best image size and resolution on Facebook.
    See how you go.

Maybe you are looking for

  • How to read file on another pc

    my application has a pc as a server and it contains files which have to be read from another ( client) pc within the lan.how do i write java code for this and what abt the formatting of file type ie itmay be pdf, html etc.

  • Dazzle dvc 150 & dazzle dvc 170

    hey i was wondering if the dazzle dvc 150 is mac compatible. or if dazzle dvc 170 will work on a mac.

  • How to turn an old laptop into a jukebox

    hi all! because this is my first post, i just want to say that i really like the arch community. didn't need to post anything until now, but since i switched to arch (2-3 years ago), this forum & wiki always helped me. so thanks! ok - i want to turn

  • Does anyone know why my slider isn't working?

    hello. I have a a slider which I am using on other sites and it works fine but i've just uploaded it to another site and it doesn't seem to load any of the images. It can be found here:  http://chumpspotter.com/chinapalace/restaurant/

  • How to open the sim compartment..

    How to open the sim compartment. I tried using a pin, but it would not open.