Help  question about calculating sum????

what do i need to fix to make it so the digits add together to give a sum i know its in the loop but i cant figure it out can someone giv me a hint
thanks
import java.util.Scanner;
import javax.swing.JOptionPane;
public class ch10q8
    public static void main(String[] args)
        String input;
        char[] array;
        int digits = 0;
        input = JOptionPane.showInputDialog("Enter numbers seperated by commas");
        array = input.toCharArray();
        for (int i =0; i < array.length; i++)
            if (Character.isDigit(array))
digits++;
JOptionPane.showMessageDialog(null, "The digits total" + digits);
System.exit(0);

Hey Mr. javakinglow, you never responded to replies in your last three threads:
[thread 1|http://forums.sun.com/thread.jspa?threadID=5376244&messageID=10656940#10656940]
[thread 2|http://forums.sun.com/thread.jspa?threadID=5376219&messageID=10656857#10656857]
[thread 3|http://forums.sun.com/thread.jspa?threadID=5373645&messageID=10642792#10642792]
This kind of implies that you possibly didn't even read the replies and that you'll likely not read or respond to replies to this thread. Are you sure that this is the message that you want to send?
Best of luck.

Similar Messages

  • Question about calculation script 'Fix'

    Hi Guys,
    I have a question about calculation script 'Fix'. Below is the sample for my question:
    Dimension 'Period' has members '2009','2010','2011'. We want to Fix the data which 'Period' is not '2009'.
    From Database Administrator's Guide we could use @NOTEQUAL, but version 11.1.1.3.0 seems not support @NOTEQUAL.
    Actually, the dimension is dynamic so we cannot use the way fixing other memebers. What should I do for this requirement?
    Edited by: 842270 on Apr 24, 2011 7:29 PM

    842270 wrote:
    Hi Guys,
    I have a question about calculation script 'Fix'. Below is the sample for my question:
    Dimension 'Period' has members '2009','2010','2011'. We want to Fix the data which 'Period' is not '2009'.
    From Database Administrator's Guide we could use @NOTEQUAL, but version 11.1.1.3.0 seems not support @NOTEQUAL.
    Actually, the dimension is dynamic so we cannot use the way fixing other memebers. What should I do for this requirement?
    Edited by: 842270 on Apr 24, 2011 7:29 PMYou can use @Remove command to avoid 2009.
    @REMOVE
    Removes values or members in one list from another list.
    Syntax
    +@REMOVE (list1, list2)+
    Parameter     Description
    list1
    +     A list of member specifications, from which the members specified in list2 are removed.+
    list2
    A list of member specifications to be removed from list1.

  • A simple question about Calculation property

    Hello friends at www.oracle.com ,
    I tried to create a summary column that sums data from another block, but it has failed - Oracle showed the FRM-30377 error, and it was needed to create a non-database item at the block to be summarized.
    This situation has raised one question: if you can't summarize data that comes from another block, why can you choose the block to be summarized at "Summarized block" at Calculation property?
    Thanks, and best regards,
    Franklin Goncalves Jr.

    You can summarize data that comes from another block. But the calculated item must be in a block that has its Single Record property set to Yes.
    So you can create the calculated item in a control block, set Single Record to Yes for the control block, and use the calculated item to display a sum of data from another block.

  • Question About Calculation

    A previous forum user help me out by giving me this code:
    form1.#subform[0].Term_Start_Date::exit - (FormCalc, client)
    // Get the number of days from the epoch for the starting date
    var startNumber = Date2Num(Term_Start_Date.rawValue,"YYYY-MM-DD")
    // Add the lease term to the startNumber
    var diff = startNumber + LeaseTerm.rawValue
    // change back to a date
    Term_End_Date.rawValue = Num2Date(diff, "YYYY-MM-DD")
    This allows me to calculate a lease date based on start date and lease length. It works like a dream. My question is currently once I choose the lease term and the lease start date I must manually click on the Term_End_Date to have it populate properly. I have this code in the "exit*" section. Is there anyway to have the field auto populate once a user pick a begining date, essentialy eliminating the need for a user to click on the Term_End_Date field?
    Thanks to the memeber's.

    You could put it on the change event of the start date field. That will populate the enddate when a start date is chosen. Now if they decide to change the lease period after the start date has been selected the calculation will not fire..... is that acceptable?
    Paul

  • Question about calculation example with Query Designer

    Hi guys,
    I have to calculate within columns and rows and I am not familiar with the settings in Query Designer that could be done to achieve the results.
    For example:
    Payments----
    Delay -
    Weighted Delay
    1000USD--10 days--
    10000
    2000USD--20 days--
    40000
    3000USD--xxx--
    50000 (this is the sum row)
    The column marked with the xxx is calculated with the sum of weighted delay divided by the sum of payments (50000 / 3000).
    Has anybody an idea how the sum row can be calculated separately?
    Thank you for suggestions!
    Edited by: saplaz on Jul 13, 2010 8:47 AM
    Edited by: saplaz on Jul 13, 2010 9:08 AM

    Hi,
    Assuming you have the Payments Infoobject in the rows and WD Infoobject in the columns; Delay as a formula object.
    > Payments----
    Delay -
    Weighted Delay
    > 1000USD--10 days--
    10000
    > 2000USD--20 days--
    40000
    > 3000USD--xxx--
    50000 (this is the sum row)
    > The column marked with the xxx is calculated with the sum of weighted delay divided by the sum of payments (50000 / 3000).
    You may try this workaround of using
    NODIM( SUMCT(WEIGH_DELAY) / SUMCT(PAYMENTS) )
    on a formula variable. (In this case, the assumption is you have not static type-restricted the rows/cols) If you find any hinderances in the default approach, you may check this out as a formula & insert this at the cell editor level.
    If not, use a simple formula variable; here define the replacement path as 0(N) for your Payments. (N being the # of digits)
    Use a simple calculation:
    SUMGT(WD)/FV
    But you may not get an result o/p in the last row, as the values are not linked (sans relation with Payments). as it will return a X for the delay in the Result row.
    Pls. let me know know if this works or some sample o/p if the initial assumption was wrong.
    Thanks,
    Arun Bala

  • Please help: question about eclipse & xerces

    hi,
    i have eclipse 3.0 and am trying to get the xerces java package (ver 2.6.2) to work for it. i downloaded xerces from this link: http://www.apache.org/dist/xml/xerces-j/
    there are so many different files in there, i'm not entirely sure if you download everything or just one. anyway, the one i downloaded was the fourth one down, called xerces.j.bin.2.6.2.zip (5.6m in size).
    i've unzipped it, but am unsure how i go about configuring eclipse 3.0 so that i can import and make use of xerces in my java apps. could anyone who has experience with this please help me?
    thanks,
    ramsey

    it's OK guys, took me ages but i got it sorted.

  • Need help: question about itunes update problem

    I started up iTunes yesterday and a window popped up saying there was a new version of iTunes to update, so I did it, and now I can't save equalizer presets! The feature doesn't work at all anymore, and it used to work great. It just goes back to Manual every time, and just won't save anything you put in. This really frustrates me, as it was one of my fave things about iTunes. Can anybody tell me what happened? Can I fix it or go back to my old version without losing my library?
    Cheers

    How do I make sure I don't lose my library? if i uninstall and then re-install an older version (which I have on disc), how do I make sure my library comes with me?

  • Help, question about "select ... for update nowait"

    There is a proc code. In the beginning of the code, I used a SQL "select ... for update nowait" in order to prevent from another proc executing at the same time. When the case happens, "-54, ORA-00054: resource busy and acquire with NOWAIT specified" will be printed in the screen.
    But there is a question: I need to print sth to indicate "another proc is running". I used "if (sqlca.sqlcode == -54)" as precondition, such as:
    if (sqlca.sqlcode == -54) {
    printf("There is another proc running.\n");
    However, this line will not be printed. I doubt that the code quits directly when using "select ... for update nowait" so as not to set value (-54) to sqlca.sqlcode.
    So, could you suggest whether there is another way that I can use to print "There is another proc running" when another proc is running?
    Thx a lot for your kindly reply.

    Yes, that link. Scroll down a bit and you will see:
    The calling application gets a PL/SQL exception, which it can process using the error-reporting functions SQLCODE and SQLERRM in an OTHERS handler. Also, it can use the pragma EXCEPTION_INIT to map specific error numbers returned by raise_application_error to exceptions of its own, as the following Pro*C example shows:
    EXEC SQL EXECUTE
    /* Execute embedded PL/SQL block using host
    variables v_emp_id and v_amount, which were
    assigned values in the host environment. */
    DECLARE
    null_salary EXCEPTION;
    /* Map error number returned by raise_application_error
    to user-defined exception. */
    PRAGMA EXCEPTION_INIT(null_salary, -20101);
    BEGIN
    raise_salary(:v_emp_id, :v_amount);
    EXCEPTION
    WHEN null_salary THEN
    INSERT INTO emp_audit VALUES (:v_emp_id, ...);
    END;
    END-EXEC;
    This technique allows the calling application to handle error conditions in specific exception handlers.

  • Network Management: Question about calculating network,host and broadcast a

    I would like to say i am new to this forum and I do not know if this is the right place to post this but i am currently in a cisco academy for CCNA and if anyone else is in this class i am stuck @ 6.2.2 in the online cisco material.....
    given the following address/prefix of 141.124.88.174/30
    enter the last octet in binary of the network,
    I am totally lost @ how to find the network octet i know /30 means the first 30bits are network and the last 2 are host i also know the last octet is 10101100 or 172
    my question how do you get .174 to .172??? if you are wondering how i know the answer --it is in the book i just dont know how to do it on my own :)
    thanks much

    Eric
    My sense is that you may have skipped a step (or maybe I skipped in understanding your post). The best way to explain this is to refer to binary - which you have started to do.
    For address ...174 the last octet is 101011 10 (in which 101011 represent the network bits and 10 represent the host bits). To find the network bits make the host bits all binary 0 - which means that the subnet address is 101011 00 or 172.
    So the answer to your question is that you get from 174 (host address ) to 172 (network address) by changing all host bits to binary zero.
    HTH
    Rick

  • I hava a question about RMI,please help me!

    Ladys and Gentleman,I hava a question about RMI.I wirte four little programs in java that is about RMI on my PC.
    import java.rmi.*;
    public interface AddServerIntf extends Remote{
    double add(double d1,double d2) throws RemoteException;
    import java.rmi.*;
    import java.rmi.server.*;
    public class AddServerImpl extends UnicastRemoteObject implements AddServerIntf{
    public AddServerImpl() throws RemoteException{
    public double add(double d1,double d2)throws RemoteException{
    return d1+d2;
    import java.net.*;
    import java.rmi.*;
    public class AddServer{
    public static void main(String args[]){
    try{
    AddServerImpl addServerImpl=new AddServerImpl();
    Naming.rebind("AddServer",addServerImpl);
    }catch(Exception e){
    e.printStackTrace();
    import java.rmi.*;
    public class AddClient
         public static void main(String args[]){
         try{
         String addServerURL="rmi://"+args[0]+"/AddServer";
         AddServerIntf addServerIntf=(AddServerIntf) Naming.lookup(addServerURL);
         System.out.println("The first number is: "+args[1]);
         double d1=Double.valueOf(args[1]).doubleValue();
         System.out.println("The second number is: "+args[2]);
         double d2=Double.valueOf(args[2]).doubleValue();
         System.out.print("The sum is: "+addServerIntf.add(d1,d2));
         }catch(Exception e){
         System.out.println("Exception: "+e);
    And I compiled these files,so I got 4 class files(AddServer.class,AddServerIntf.class,AddServerImpl.class,AddServerClient.class).Then I use "rmic AddServerImpl" got another two files(AddServerImpl_Skel.class and AddServerImpl_Stub.class).Then I input command:rmiregistry,in another window,I input command:java AddServer,I got some exceptions,I was confused by these exceptions.The exception is:
    D:\MyJava\rmi_3>java AddServer
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: AddServerImpl_Stub
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: AddServerImpl_Stub
    java.lang.ClassNotFoundException: AddServerImpl_Stub
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Unknown Source)
    at AddServer.main(AddServer.java:8)
    But some times this exception will not appeared.Who can give me answer or suggestion,thanks a lot.
    By the way,when I run shutdown.bat in tomcat_root\bin,I can get some exceptions:
    C:\Tomcat\bin>shutdown
    Using CATALINA_BASE: ..
    Using CATALINA_HOME: ..
    Using CATALINA_TMPDIR: ..\temp
    Using JAVA_HOME: C:\JDK
    Catalina.stop: java.net.ConnectException: Connection refused: connect
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:579)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
    I use Windows server 2000+JDK 1.3.1_04+tomcat 4.1.7

    Maybe I am off base here but it seems to me the problem is the way in which you bind your server. The server must be bound to the same address and you are looking up from, i.e. "rmi://" host "/AddServer"
    so
    Naming.rebind("AddServer",addServerImpl);should be
    Naming.rebind("rmi://127.0.0.1/AddServer", addServerImpl);to match
    String addServerURL="rmi://"+args[0]+"/AddServer";
    AddServerIntf addServerIntf=(AddServerIntf)
    Naming.lookup(addServerURL);Hopefully this will solve your problem, if not it is a problem with your classpath. An easy way to make sure it can see your files is to set the java.rmi.server.codebase to point to where your classes are, e.g.
    java -Djava.rmi.server.codebase=file:"c:\\cygwin\\home\\tweak\\keck_folder\\cmsi401\\RMIGalaxySleuth\\classes\\" AddServer
    I had to set the codebas for my rmi stuff to work no matter how much I messed with the classpath.
    Hope this helps,
    Will

  • Question about the ability of Genius Bar to help with outside software...

    Hi I wasn't sure where to put this, but here's my question. I'm having a problem with the Sims 2 on my Macbook and I was wondering if I go to the Genius Bar will they be able to help me or are they strictly hands off when it's not a direct Apple product?
    Also, I bought an external hard drive in the Apple Store but it's not an Apple branded product. If I'm having a problem with that, can I go to the Apple Store?

    If it's a question about the installation, system requirements or compatibility with your MacBook, the Mac Genius can probably help. If you're having some kind of issue while using the Sims 2, you'll probably have to contact .
    The same is true with the hard drive. If you need some help getting it connected or even formatted, they can probably help. However, if it's not powering up or you're losing files or some kind of operational issue with the hard drive after it's connected, they'll probably refer you to the manufacturer.
    Usually Apple can't support other vendors' products. Someone here may be able to give you some more advice, since none of us work for Apple. There may be someone here who's already had the same issue with the Sims.
    -Doug

  • Please help me about question security because in my apple id no have for restart or chenge my answer

    please help me about answer security question in my apple id because im forgot for my answer, in my apple id no have for change answer, tell me for this please because i love my iphone.
    <Email Edited by Host>

    You need to ask Apple to reset your security questions; this can be done by clicking here and picking a method, or if your country isn't listed, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (110899)

  • Question about 890GXM-GD65 ? any help..? tq

    Dear people..
    I have a question about this board MSI 890GXM-GD65, maybe somebody could help me with the answer...Do the board have an unlock cpu core bios like 785GM-E51 ...? thanx in advance..

    Have a look: http://eu.msi.com/index.php?func=downloaddetail&type=manual&maincat_no=1&prod_no=2012

  • Hello , I want to ask some question about ipads \  How powerful is the iPad?  How useful is it for reading books, newspaper or magazines or for surfing the web? Can you identify any shortcomings of the device?   please help me :(

    Hello ,
    I want to ask some question about ipads \
    How powerful is the iPad? 
    How useful is it for reading books, newspaper or magazines or for surfing the web?
    Can you identify any shortcomings of the device?  
    please help me

    it's less powerful than your average computer. THink of it like a netbook but with a better processor.
    It'll do fine for surfing (although if you browse a lot of flash based sites you will need to get a third party browser since safari doesn't accommodate it)
    You may do OK on reading books, papers or magazines, especially if they have apps, but the ipad's screen is backlit, so it doesn't work well outdoors and you may need to fiddle with the brightness so that you don't get eye strain (it's just like doing too much reading from a computer screen)
    I would say the biggest short comings are data transfer. Apple's preferred work flow is that everything is done via iTunes or the internet....well people dont' always have 100% reliable always on internet access so you can find yourself in a situation where you can't get things on/off the iPad.
    By and large, it's a good device for day to day stuff, but is not a computer replacement.

  • I have an urgent question about my indesign. I had problems with the creative cloude app and then uninstalled it and then installed it again. Now it is not opening and I cannot download it again either. Pls give me help and advice if there is anything I c

    I have an urgent question about my indesign. I had problems with the creative cloude app and then uninstalled it and then installed it again. Now it is not opening and I cannot download it again either. Pls give me help and advice if there is anything I can do to repair it

    Please authorize ADE 3 with same credentials that you used with older version of ADE

Maybe you are looking for

  • Image capture not working in lion

    Well! After 10 years or so of OS X my Kodak DC 5000 no longer works in image capture after upgrading to OS X Lion. After connecting the camera and trying to import images, Image Capture says "no device connected". Went to the loca shop and using the

  • Getting Error While Going For Print Preview in ALV Report

    Hi, We doveloped a new report based on client requirment while going for print preview all the fields are shufling.Can you please guide me I am unable to solve this problem. Regards Suresh

  • Mesage was struck in SMQ1

    Hi      I'm sending data from ECC to XI   through RFC .. but the thing is working fine. in Development server .. after moved the objects from Development to Qualityserver  .. when ever i execute the report in ECC for triggering the Proxy.. the data w

  • RBAC or Mailbox impersonation setting

    We use a product from Sherpa Software called Archive Attender to archive message content off to a different server and leave a stub in the message that allows the user to retrieve that content.  I have a user called Super that is a member of the doma

  • Very happy with SONY customer service

    I had a problem with my new SONY Xperia Z3 and I'm very happy and grateful to SONY customer service. They fixed the problem very fast and in a very comfortable way. My next Smartphone will be a SONY, of course! Thank you very much SONY Luis