Alil help plz thanks :)

ok so im trying to get my program to read a txt doc with something like
Alfred 90 74 60 100 80 75 95.0
Bea 60 82 66 59 92 72 74
Leila 100 98 90 100 82 85 95
Fred 65 75 75 70 82 66 50
Anna 50 76 30 33 90 74 56
Ada 10 89 76 90 90 90 90
Hermud 100 95 95 100 75 85 78
Jimmy 70 65 80 55 66 77 89
Cecil 53 67 34 78 38 47 90
Smiley 10 10 30 17 50 56 00
and i want it to print off something like
Alfred: 79.8
Bea: 71.3
Leila: 93.8
Fred: 69.8
Anna: 56.5
Ada: 71.0
Hermud: 91.8
Jimmy: 71.7
Cecil: 56.1
Smiley: 22.299999999999997
import java.io.File;
import java.io.FileNotFoundException;
import java.util.NoSuchElementException;
import java.util.Scanner;
public class practice{
        // method reads a String from a file opened using Scanner
     public static String readString(Scanner scan) throws NoSuchElementException {
      return scan.next();     
    // method reads a Double from a file opened using Scanner
     public static Double readDouble(Scanner scan) throws NoSuchElementException {
      return scan.nextDouble();     
      * @param filename and number (count of lines in file)
      * @throws FileNotFoundException
      * read name then 7 scores
      * first three scores weighted by .2, last four by .1
     public static void main(String[] args) throws FileNotFoundException {
         // access the args and make them available to method
          String inputFileName = args[0];
          int numberOfStudents = Integer.parseInt(args[1]);
          // check that the args were properly read
          boolean debug = true;
          if (debug) {
               System.out.println("Input file: " + inputFileName);
             System.out.println("Number of students:" + numberOfStudents);
          // open a file and set it up to be read
          Scanner scan = new Scanner( new File (inputFileName));     It seems to be having troubles when i create the txt document and run that txt document as an arg

oh sorry my bad its bringing up
Exception in thread "main"
java.lang.ArrayIndexOutOfBoundsException: 1
     at ComputeGrades.main(ComputeGrades.java:27)
and i dont really know how to get started on
calculating the individual scoresIt looks like the program is expecting 2 arguments to be passed into main, and only one is.
if(args.length < 2)
     System.out.println("Proper Usage is : java ComputeGrades <filename> <numberOfRecordsinFile>");
     System.exit(0);
}

Similar Messages

  • I have just getting a new phone and I have forgot my password an Apple ID what I made new for the new phone now I cannot get on it because asking for id and password what should I do help plz thank u

    I have just getting a new phone and I have forgot my password an Apple ID what I made new for the new phone now I cannot get on it because asking for id and password what should I do help plz thank u

    Try
    https://iforgot.apple.com

  • I can resived  any SMS but can't open it , my I phone it's 4 G , help plz thanks, I can resived  any SMS but can't open it , my I phone it's 4 G , help plz thanks

    I can resived  any SMS but can't open it , my I phone it's 4 G , help plz thanks, I can resived  any SMS but can't open it , my I phone it's 4 G , help plz thanks

    You can try closing the message app by following those instructions: http://support.apple.com/kb/ht5137

  • Hello..i have IPhone 4S i did reset to factory settings by fault and till now after a 2 hours there is nothing just a waiting icon in the middle of the screen and none of home or turn off button are response so i do need your help plz

    hello..i have IPhone 4S i did reset to factory settings by fault and till now after a 2 hours waiting (as known it takes a 1 to 2 minutes maximum) there is nothing just a blank screen and a running waiting icon in the middle of the screen and none of home or turn off button are responsed so i do need your help plz & thanks in advance..

    Try to reset it by holding the power an home buttons at the same time until you see the Apple logo, then release.  If it won't reset, you'll probably have to force it into recovery mode and restore it, as explained here: http://support.apple.com/kb/ht1808.

  • I restored my Macbook Pro and now I can't log in as Admin - it says there is an error with FileVault and I don't have access - plz help!  thank you.

    I had to restore my Macbook Pro from Time Capsule yesterday and now when I go to log in as my usual Admin, it says there is a FileVault error and my access is denied.  I created another temporary Admin acct, but everything I had on my desktop, etc is "gone"  I can look up the "drive' or wahtever it's called, but I can't access any of it.  All I want to do is log back in as my usual self (the regular Admin) - plz help!  Thanks.   p.s. I"m (obviously) not that computer savvy!

    Triple-click the line below to select it:
    /System/Library/CoreServices/Directory Utility.app
    Rght-click or control-click the highlighted text and select
    Services ▹ Open
    from the contextual menu.* The application Directory Utility will open.
    In the Directory Utility window, click the lock icon and authenticate. Select the Directory Editor tool in the toolbar. Select Users from the Viewing menu in the toolbar, if not already selected. Select the affected user account in the list. On the right is a list of properties and values. Select the property "HomeDirectory" and delete it by clicking the minus-sign icon directly below the property list. There are two such icons in the window. You want the one on the right, not the one on the left.
    CAUTION: Do not click the minus-sign icon on the left, below the user list.
    Then click the Save button in the lower right corner of the window. Quit Directory Utility.
    CAUTION: There is no "undo" in Directory Utility. If you make a mistake and delete something in the Directory Editor that should not have been deleted, restore your whole system from a backup and start over. I have no other help to offer in that case.
    Try again to log in as the affected user. If you can log in, you should find a file in the home folder with the name of the user and the filename extension "sparseimage" or "sparsebundle". Double-click that file. A disk image should open. Copy your files from that disk image to restore them.
    I strongly suggest that you deactivate legacy FileVault in the Security & Privacy preference pane, then log out and log back in. Consider activating FileVault 2 if you want that kind of security.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard (command-C). Open a TextEdit window and paste into it (command-V). Select the line you just pasted and continue as above.

  • I cant get voice over to work on my 4G shuffle it clicks off every time help plz

    i need help plz it wont work

    Hello,
    Welcome to Adobe Forums.
    Try uninstalling Adobe Flash Player from Flash Player uninstaller : http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-mac-os.html#main_uninstall
    Try a clean installation using this KB : http://helpx.adobe.com/content/help/en/flash-player/kb/installation-problems-flash-player- mac.html
    Thanks,
    Vikram

  • Help Plz.......!!!!its urgent

    hi nokia users
    flash lite on my 5530 only plays youtube videos,and when tried to play videos on other sites then it says flash player is required............do ui use any software that supports web videos...???
    help plz.....
    thanks in advance

    Falshplayer vedio cant acces in your device?

  • Help plz, i need back up my phone

    Help plz, i have iphone 4 i still have icloud  on my itunes and i need to update it to the new one but i dont want to lose any of my pictues of my kids im not sure if ive backed it up before if i have it would of been a long time ago plz help me thanks

    jennyspeedy* wrote:
    i dont want to lose any of my pictues of my kids im not sure if ive backed it up before if i have it would of been a long time ago plz help me thanks
    Then use the device as designed.  Copy the pictures off the device to the computer.  For any pictures that you desire to keep on the device, simply sync them via iTunes.
    Failure to copy the pictures off the device is only asking for problems.  If the device is ever lost/stolen or simply fails to work, without a backup they would be gone as well.

  • How can we create a Collective search help  plz tell me with steps

    How can we create a Collective search help  plz tell me with steps
    thanks,
    basu

    Hi
    1) Elementary search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).
    2) Collective search helps combine several elementary search helps. A collective search help thus can offer several alternative search paths.
    3)An elementary search help defines the standard flow of an input help.
    4) A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.
    5)A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.
    6)Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.
    CREATION:
    Go to SE11  Tcode
    select search help
    give the 'z' search help name and create
    select the selection method ur table name eg : 'mara'
    dialog module 'display value immediately'.
    add the field whatever u want and lpos = 1 and spos = 1 and check import and export parameter.
    where left position when displaying and spos = search position
    and then save and activate ..
    See the links:
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee45446011d189700000e8322d00/content.htm
    pls go through this for search help creation
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    Search Help Exits:
    Re: dynamic values for search help
    Re: Dynamic search  help
    Reward points for useful Answers
    Regards
    Anji

  • 1 button to do create in 2 iteraitories  in one  page, how can help plz

    hi every one
    how can i make one button in one single page do the create action for two iteraitories in that html page
    “in other words.” i have two tables in one html page I want use one butten in the html page to create new row for each
    thank you ;

    Hi,
    see 1 button to do create in 2 iteraitories  in one  page, how can help plz
    Frank

  • Re: Help plz Mar 23, 2013 3:26 AM (in response to diesel vdub) Ok . What should i do here . Iam i update or no . Im bought this iphone 1week ago and i bought it with jailbreaking and i want update to 6.1.3  what can i do?? My device is on 6.1.2)  my iphon

    Re: Help plz
    Mar 23, 2013 3:26 AM (in response to diesel vdub)
    Ok . What should i do here . Iam i update or no . Im bought this iphone 1week ago and i bought it with jailbreaking and i want update to 6.1.3  what can i do?? My device is on 6.1.2)  my iphone is not international i can only start with 1SIm  i heared tjat if i upate my Device it likely willnot camebackagain..! Is that right.. Thankes.!

    Apple considers jailbreak a misuse of product.  Any Apple.com site will refuse to support.
    If you bought it with jailbreak intentionally, you made a mistake.
    If you found out only after purchase, get your money back by returning it.

  • I have frequent instances of my Macbook Pro beeping 3 times and then I have to forcefully shut it down by pressing the power button. What is this all about? Please help. Thank you.

    I have frequent instances of my Macbook Pro beeping 3 times and then I have to forcefully shut it down by pressing the power button. What is this all about? Please help. Thank you.
    I saw this report being sent to Apple:
    Interval Since Last Panic Report:  581719 sec
    Panics Since Last Report:          10
    Anonymous UUID: F4CF708D-D85C-4EC5-8047-4FC22C6B03AF
    Fri Mar  7 13:00:14 2014
    panic(cpu 0 caller 0xffffff80002d1208): Kernel trap at 0xffffff800020c590, type 14=page fault, registers:
    CR0: 0x0000000080010033, CR2: 0x0000000000000000, CR3: 0x0000000007541000, CR4: 0x0000000000040660
    RAX: 0xffffff8000000000, RBX: 0xffffff800d35a870, RCX: 0xffffff800cf55cd8, RDX: 0xffffff80008a8fcc
    RSP: 0xffffff805e5f3d60, RBP: 0xffffff805e5f3da0, RSI: 0x000000001dcd6500, RDI: 0xffffff800d168778
    R8: 0x0000000000000001, R9: 0xffffff805e5f3e88, R10: 0x0000000000000011, R11: 0x0000000000000000
    R12: 0x0000000000000000, R13: 0xffffff800d168770, R14: 0xffffff800d168778, R15: 0x0000000000000000
    RFL: 0x0000000000010082, RIP: 0xffffff800020c590, CS:  0x0000000000000008, SS:  0x0000000000000010
    Error code: 0x0000000000000000
    Backtrace (CPU 0), Frame : Return Address
    0xffffff805e5f3a00 : 0xffffff8000204d15
    0xffffff805e5f3b00 : 0xffffff80002d1208
    0xffffff805e5f3c50 :
    Model: MacBookPro8,1, BootROM MBP81.0047.B27, 2 processors, Intel Core i5, 2.3 GHz, 4 GB, SMC 1.68f99
    Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In, 384 MB
    Memory Module: global_name
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 5.100.198.104.5)
    Bluetooth: Version 2.4.5f3, 2 service, 12 devices, 1 incoming serial ports
    Serial ATA Device: Hitachi HTS545032B9A302, 298.09 GB
    Serial ATA Device: OPTIARC DVD RW AD-5970H
    USB Device: FaceTime HD Camera (Built-in), 0x05ac  (Apple Inc.), 0x8509, 0xfa200000 / 3
    USB Device: Hub, 0x0424 (SMSC), 0x2513, 0xfa100000 / 2
    USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000 / 5
    USB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.), 0x821a, 0xfa113000 / 8
    USB Device: Apple Internal Keyboard / Trackpad, 0x05ac  (Apple Inc.), 0x0245, 0xfa120000 / 4
    USB Device: Hub, 0x0424 (SMSC), 0x2513, 0xfd100000 / 2
    USB Device: IR Receiver, 0x05ac  (Apple Inc.), 0x8242, 0xfd110000 / 3

    Hmm. The problem still may be the RAM - Apple buys the RAM it puts in its machines from third-party vendors (usually Hynix) so it could be a RAM problem.
    There are a couple of things that you can do yourself before taking your machine into an Apple Store or an AASP... download and run an application named Rember that will run a RAM test for you - let it run for a couple of hours or even overnight. If it turns out that your RAM is faulty, Rember will let you know. If it is faulty, then you have a couple of options - replace the RAM yourself or (particularly if you're under warranty still) take the machine to an Apple Store or AASP and have them replace the RAM.
    If Rember finds no fault with the RAM, then you'll need to take it into an Apple Store/AASP and get a free diagnosis on the machine. Three beeps do usually indicate faulty RAM, but if it tests good with Rember you likely have another problem - it could be something as simple as the RAM, somehow, not seated correctly or signs of another hardware problem.
    Run Rember first... call back with results.
    Good luck,
    Clinton

  • I have installed Mountain Lion 10.8.2 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    I have installed Mountain Lion 10.8.2 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    You can go to the Apple online store and purcahse a copy of Mountain Lion.  This will give you a redemption code, which you can use to download Mountain Lion from the App Store.  Unfortuantely, I'm not aware of any other way to legally purchase it.  I have never seen Apple release Muontain Lion on DVD.
    In terms of Apple Service, they just need the serial number of the machine to check the purcahse date.  It is usually correct, to within a few weeks.  A quick Google search should give you the correct number to dial.
    I hope this helps.

  • I have installed Mountain Lion 10.8.1 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    I have installed Mountain Lion 10.8.1 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    I would delete the account and try to re-enter it. Also, you have to let your firm's IT department know that you want to sync work email on your personal devices before they actually work.

  • I cannot figure out how to make the text larger on an incoming email.  The finger method doesn't work and I cannot find any toolbar with which to do it.  I could find nothing in settings also.  Plese help and thank you.

    I cannot figure out how to make the text larger in a received email.  The finger method doesn't work and I can find no tool bar as I can for composing emails.  I can find nothing in settings.  Please help and thank you in advance.

    Hi there,
    Download a piece of software called TinkerTool - that might just solve your problem. I have used it myself to change the system fonts on my iMac. It is software and not an app.
    Good wishes,
    John.

Maybe you are looking for

  • Cfmail spool sending one message at a time

    I have mx7 standard installed on win 2003 server a cfmail page sends files to the spool corectly. The spool is only sending out one message every 60 seconds or so. Changing the spool interval has no effect. these need to go out a lot faster than this

  • Adding music to more than one slide and not the entire presentation

    I love the way Keynote looks and behaves, but it fails to compete with PPT on certain aspects, such as adding the same audio track to more than one slide and NOT have it play for the entire presentation. Using PPT (and I hate PCs!) you can have a tra

  • What are the iphoto files I need to restore iphoto library deleted from drive

    A few days ago my hard drive started making noises and I was getting all sorts of errors.  I even got errors trying to do a time machine backup with the final error being "backup failed". Earlier last week I imported a couple hundred photos of my kid

  • Child .swf controlling parent timeline

    Hello Captivate Heroes, I've searched around, and can't seem to find any solid info on an issue my team is having. I'm a bit of a noob when it comes to Javascript, so I apologize if this question is too basic for this forum. Is it possible for an emb

  • Imac only has 2 resolutions

    My wife's Mac changed resolutions - possibly as a result of running a full-screen game.   She says it has happened before.   I told her to reboot and let me know if that helped. It didn't, so I went to settings to change its resolution, seeing only 2