How do I change this so the average has a decimal and zero?

I'm trying to get this so that instead of like 90 I'll get 90.0
oneString = JOptionPane.showInputDialog("Choose a test score 0-100");
          one = Integer.parseInt(oneString);
          twoString = JOptionPane.showInputDialog("Choose another test score");
          two = Integer.parseInt(twoString);
          threeString = JOptionPane.showInputDialog("Choose another test score");
          three = Integer.parseInt(threeString);
          fourString = JOptionPane.showInputDialog("Choose another test score");
          four = Integer.parseInt(fourString);
          fiveString = JOptionPane.showInputDialog("Choose another test score");
          five = Integer.parseInt(fiveString);
          sixString = JOptionPane.showInputDialog("Choose another test score");
          six = Integer.parseInt(sixString);
          sevenString = JOptionPane.showInputDialog("Choose another test score");
          seven = Integer.parseInt(sevenString);
          eightString = JOptionPane.showInputDialog("Choose another test score");
          eight= Integer.parseInt(eightString);
          nineString = JOptionPane.showInputDialog("Choose another test score");
          nine = Integer.parseInt(nineString);
          tenString = JOptionPane.showInputDialog("Choose another test score");
          ten = Integer.parseInt(tenString);
          elevenString = JOptionPane.showInputDialog("Choose another test score");
          eleven = Integer.parseInt(elevenString);
          twelveString = JOptionPane.showInputDialog("Choose another test score");
          twelve = Integer.parseInt(twelveString);
          thirteenString = JOptionPane.showInputDialog("Choose another test score");
          thirteen = Integer.parseInt(thirteenString);
          sum = (one+two+three+four+five+six+seven+eight+nine+ten+eleven+twelve+thirteen);
          mean = (sum / 13);
          System.out.println("The average of the scores is "+mean);

I advise you to look at your code and ask yourself if it's efficient. What is you wan to add a few numbers to your program? You'll have to add a lot of lines of code.
Ah well, here's the answer to your question (partially):
    double sum = (one+two+three+four+five+six+seven+eight+nine+ten+eleven+twelve+thirteen);
    double mean = (sum / 13);
//...

Similar Messages

  • I have copied over my music file to a new computer and the music shows on itunes but wont play. When I track where the song is located it is reading the wrong information. How do I change this as Edit Preferences has the right location

    I have copied over my music files to a new computer and the music shows on itunes but wont play. When I track where the song is located it is reading the wrong information. How do I change this as Edit>Preferences has the right location?

    Select one of the tracks with a broken link, press ctrl-i to Get Info. Say No when iTunes asks if you would like to locate the track, then look at the Summary tab for the location expects to find the file in.
    Now try to locate the file in question. The two locations should give a clue as to what to do next.
    Here is an example with a file I've deliberately moved from the new layout to the old pre-iTunes 9 layout.
    This means iTunes is expecting to find the file at:
    D:\iTunes\iTunes Media\Music\a-ha\Take On Me\01 Take On Me.mp3
    but it isn't there because I've moved it to:
    D:\iTunes\iTunes Media\a-ha\Take On Me\01 Take On Me.mp3
    which is where it would have lived back in iTunes 8 (though the media folder would have been called iTunes Music back then as well).
    If you can provide the expected and actual locations of a broken track I should be able to suggest the easiest way to resolve things.
    tt2

  • My messages won't say the contact name only shows the phone number, how do you change this when the contact is in my phone under that number already?

    My messages won't say the contact name only shows the phone number, how do you change this when the contact is in my phone under that number already?

    I thought that at first, but I have text this person before and had received responses in a timely manner. Its just weird that it all of a sudden removed their name.
    Would this affect the delivery of the text message?

  • HT2204 I have 3 iphones and all use the same apple ID,how do I change this so each phone has its own id,do i restore the phones to factory settings first??as im having problems with contacts being added to and deleted from each phone.

    I have 3 Iphone 4S and all have the same apple ID which is causing problems as far as contacts are concerned,when i sync 1 of the phones to my comp the contacts appear on all the phones.How do i create a new ID for each of the phones do I have to reset the phones to factory settings first,any help would be appreciated.:)

    Hello marie196,
    Thanks for the question, and welcome to Apple Support Communities.
    You do not necessarily need to restore the device to factory settings, but rather sign out of the four services that utilize your Apple ID: iCloud, iMessage, FaceTime, and iTunes & App Stores. Once signed out, you can sign in with a new Apple ID. For more information, see the following article:
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Additional Information: You may encounter an error regarding a 90-day limit. For information on this, see the following article:
    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/HT4627
    Thanks,
    Matt M.

  • HT5622 I have changed my Apple ID, but when I try to login to iTunes it still shows my old Apple ID thus not allowing me to log in. How do I change this in the system?

    How do I change my Apple ID when I go into iTunes. It seems when I log into apple web site it recognizes my new Apple ID, but iTunes does not. How do I change my iTunes Apple ID?

    Have you change your apple id on your iphone?
    settings - store - apple id - sign out - then log back in with desired id.

  • I have an iPhone 4S I have done the recent update 6.1 and now my App Store is not working when I go into the feature tab I get an error " too many HTTP redirects" how do I fix this ? The other tabs are working and it is working on my iPad also

    I am having a problem getting into the App Store on my iPhone since the recent update, I have a 4s and it appears the feature tab is not working. When I try to go into the feature tab in the App Store I get a message "too many HTTP redirects" ?... Does anyone now hoe to fix this issue, the other tabs are working okay and everything is working on my iPad ?

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router (Auto is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • How do I change back to the US store to update and access new apps?

    When I attempt to update my ipad2 apps it tells me I'm in the UK  store. How do I get in the us store. I shut down and turned back on. I signed in on the US apple site and am still getting the same pop up.

    Try going to the bottom of the Featured tab in the App Store app on your iPad and tap on your account id, tap on 'View Apple ID' on the popup and log into your account, and then select the Country/Region section and select the US.

  • I need more than the maximum allowed 30 profiles - how do I change this?

    I need more than the maximum allowed 30 profiles - how do I change this? Once I reach 30 profiles and I try to add one - it just deletes one automatically thus only allowing a maximum of 30. Please help.

    You are talking about 30 Firefox Profiles on the same Windows Logon User Account?
    I never saw that as a limit myself. I had 53 Profiles at one time, although I haven't done that since Firefox 3.0. It was causing an extended launch time and I started using "remote" Profiles that weren't controlled by the Profile Manager and weren't in the '''profiles.ini''' file; launched by command line. Like this in the Target line for the desktop shortcut: <br />
    ''' "C:\Program Files\Firefox_4.0_zip\firefox.exe" -Profile D:\Mozilla\Active-Profiles\4.0_10-15-10-N '''

  • Preview: In a group of PDF files in the same window, going to the next or a previous PDF file displays the bottom of PDF by default, not the top. How do you change this?

    Preview: In a group of PDF files in the same window, going to the next or a previous PDF file displays the bottom of PDF page by default, not the top of the PDF page. How do you change this? In Mac OS 10.9 and previous, going to the next or previous PDF file displays the top of the PDF by default. Is there a way to change this back? When I go to the next or previous PDF file, I want to first view the top of the page, not the bottom. This really doesn't make any sense. Any help? Thanks!
    MacBook Air (13-inch, Mid 2012)
    2 GHz Intel Core i7
    8 GB 1600 MHz DDR3
    500 GB Flash Storage
    Preview Version 8.0 (859)
    Mac OS 10.10.1

    That to me seems like a bug in Yosemite.
    Apple Feedback http://www.apple.com/feedback/
    Bug Reporter https://bugreport.apple.com/

  • My mac has had refresh and install now my password will not work on the hardrive how do i change this?

    my mac has had refresh and install now my password will not work on the hardrive how do i change this?

    Boot from your install disk and when you reach the Install screen choose Change Password from the Utilities menu.
    Also check this Apple article http://support.apple.com/kb/HT1631

  • ITunes store set to UK (I live in US) How do I change this?

    Somehow (I think it was while I was upgrading to Leopard) my iTunes store got set to the UK version. (the prices of songs are set as pounds, etc. etc.) How do I change this to the American/US version?
    Message was edited by: Zoopid

    Zoopid wrote:
    Somehow (I think it was while I was upgrading to Leopard) my iTunes store got set to the UK version. (the prices of songs are set as pounds, etc. etc.) How do I change this to the American/US version?
    Message was edited by: Zoopid
    Look at the bottom of the iTunes store front page. You should be able to change store.

  • I changed my apple id (new email address) and when i use my ipad, it still comes up w old id how do i change this

    I changed my email address, which then changed my userid for itunes.   however, on my ipad, it still comes up old userid email address. how do i change this on the ipad

    Tap on your id in Settings > iTunes & App Store and log out of it, and then log back in with the updated version of your account so as to 'refresh' the account on your iPad
    Things that you might need to do after changing your primary email address : Apple ID: What to do after you change your Apple ID

  • How can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    how can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    If you are just visiting Singapore, then leave the account as it is. If you have moved there, then view your account using the iTunes app on a Mac or PC and change the country/region to your current location and address. If you do not have a bank card, you can fund your account using iTunes gift cards if available in Singapore.

  • When I share a pages document as a PDF (via e-mail) all the pictures change from the original document, most are missing with just a few of them repeated in the spots where others had been.  How do I do this without the document changing?

    When I share a pages document as a PDF (via e-mail) all the pictures change from the original document, most are missing with just a few of them repeated in the spots where others had been.  How do I do this without the document changing?
    I need to be able to send it to a PC in order to print it.

    Hard to say what is happening without examining the file.
    If you like click on my blue name and email me both the .pages file and the the .pdf you have made from it.
    Peter
    ps It would help to say what version of Pages you are using and on what you are running it. iOS or Mac and what version.

  • When I create a New Folder (on the desktop or in Finder), the system uses the Generic Document Icon instead of the Generic Folder Icon. How can I change this back?

    When I create a New Folder (on the desktop or in Finder), the system uses the Generic Document Icon instead of the Generic Folder Icon. How can I change this back?
    All of a sudden I noticed that most of the folders on my computer were no longer using the folder icon, but the generic document icon. I had to manually change back the icon being used by opening Get Info for each folder and copying and pasting the generic folder icon from some folders that remained unchanged. Now whenever I create a New Folder (right click -> "New Folder"), the icon that shows up is the generic document icon (white page with top right corner turned down). And I have to manually change it so it shows up as a folder in Finder or on my desktop. I don't know why or how this switch happened. All of the folders now on my computer look ok, but I need to change the default so when I create a New Folder it uses the correct icon.
    I have also Forced Relaunch of my Finder and rebooted the system. I downloaded Candybar but am not sure what will fix anything, so I haven't proceeded.
    Anyone know how I can do this? Thanks.

    Anyone?

Maybe you are looking for

  • How do u convert a numeric value to char

    hi, how do u convert a numeric value NUMBER(22) to a character value.... like a to_char() function? i've tried the CAST function it won't work.

  • Multiple Line Graph

    First off, thanks to kglad for the line graph function I started with, it has been a huge help. Now the step I'm trying to take is 2 fold. First, I'd like to graph more than one line segment on the graph. Right now I am graphing functions f1 and f2,

  • My RIA doesn´t work in Chrome. Shockwave crashed!

    Hi friends! I´m working in a Web RIA site, with music, audio, video recording, video incorporated (youtube flash Api) and 3d Engine like Flare3D. I´m using Flash Builder 4.7 Beta, and a Flex Project. At work i use windows, but if you tell me that wor

  • Iphone 3gs is broken and want to put the sim in my old iphone 3....how do i get the old phone to recognise the sim

    can anyone help...my iphone 3 gs 16gb is knackered. i want to use the old iphone 3 we have but it wont recognise the sim. its on o2 the same as the old phone was, but the number / sim is different than it was when i was using the old phone.

  • Make Your Families and Friends A Video for Christmas

    What are you going to give your friends/families for Christmas? Do not decide yet? Here I will give you a suggestion. You can make a video and send to them. It will be a great present for them. You may make a video from your own media source: videos,