How to add three values together?

Hi,
I'm working on a program which is supposed to be able to add three numbers together like this: (notice that the program asks for three numbers. these three numbers are the ones to be added up, see below)
Enter number one:
*5*
Enter number two:
*10*
Enter number three:
*15*
What i want the program to do is to add these three numbers together and print THE SUM (30) not the three numbers. This is how the code which I use to print out the values looks now:
System.out.println("the sum of the numbers is" + (num1) + (num2[i]) + (num3[i]) + "hours");
What the programs does is that instead of printing the sum (30), it prints: 51015 (thus, the typed numbers, side by side...).
What can i do to make the program print the sum of the three numbers and not the three numbers itself. Thanks in advance..
Edited by: mikk3l on Sep 16, 2007 6:03 AM

thx for the tip, still doesn't work though. This is how it looks:
First part, declaring variables:_
String aname;
         int i = 0;
         String[] name;
         name=new String[3];
         String[] aa;
              aa= new String[3];
              String[] ab;
              ab=new String [3];
              String [] ac;
              ac=new String[3]; and here is the second part where the program is supposed to print the sum of aa, ab and ac:
System.out.println(aname + " has totally " + ((aa)+(ab[i])+(ac[i])) + " hours");
Please let me know if there's any other part of the code you need.*

Similar Messages

  • In Scom,How to add CAC value in given MP (management pack)? Please give me in detail procedure with example if possible.

    In Scom,How to add CAC value in given MP (management pack)? Please give me in detail procedure with example if possible.

    Hi 
    CAC is System.ConsolidatorCondition condition detection module used to consolidate the monitoring i.e. you can generate an alert on multiple occurrence of issues instituted of generating single alert for issue.
    refer below link for more information
    http://msdn.microsoft.com/en-us/library/ee809324.aspx
    http://social.technet.microsoft.com/wiki/contents/articles/20301.how-to-add-consolidation-for-url-monitoring-in-scom-20072012.aspx
    Regards
    sridhar v

  • How to add field value to the standard table

    Hi,
    How to add field value to the standard table?
    for example:
    when we go to TCODE SE16-> VBAK table -> on the selection screen if we press F4 against VBTYP we get all the available values for that field. How to add a new document Category value to this field so that it shows up in F4 help for that field.

    Hi Asif,
    I don't think it is possible and feasible for adding new field value to the field VBTYP because it is not possible through SPRO.
    If u see the domain of this field VBTYP we have fixed values provided by SAP. There is no value table for this. If u have value table then it will be updated through SPRO. But still if u really want to add some value u can do that by getting access key and add the value in the fixed values of the domain. But of no use other than simply displaying in F4. Because for what ever value u created here there will be no documents in VBAK or any table using this domain.
    Hope this is clear for u.
    Thanks,
    Vinod.

  • How to add integer value of two buttons?

    how to add integer value of two buttons (any button) in VI and display it in output text box? i have attached example program, but i know its wrong.. please help
    Solved!
    Go to Solution.
    Attachments:
    add.vi ‏8 KB

    thanks for reply. i am trying to assign an integer value to a button and the button should send the assigned integer value to TCP/IP write, only when the button is pressed. i am able to send data using string control (as shown in the attachment) but i want to replace it with several buttons. for example, if i enter 2 in string control, this data will be sent to a robot (robot has wifi card)  through tcp/ip protocol, it moves front. 3 will make it to move back, 8 is left, 6 is right. this numeric data is already burnt into blackfin processor of the robot. so just by entering numbers in labview can make my robot move in specified direction. can you please help me to create a button with value and convert it into string and send it to tcp/ip write. this should happen only when the button is pressed. because, if i enter numbers in string control, it dosent looks good..... if i have buttons... i think my VI will look good and hitech.
    Attachments:
    robo.vi ‏9 KB

  • How to add three views in MM01

    How to add three custom views in MM01 based on material type.
    Regards,
    Malla

    hi,
    This will solve your problem.
    [https://forums.sdn.sap.com/click.jspa?searchID=19403068&messageID=5708251]

  • How to add two values

    How to add varchar values in oracle.Consider as both are time values.but the data type[both] is varchar and stroed in table
    For example:
    Column1 Column2
    2.40:10 PM 5:22:00
    i need the result for the following format
    8.02[8 hours and 2 minutes]

    with c as
    (select '2:40:10 PM' t1, '5:22:00 PM'  t2  from dual)
    select hr+level ||':'||to_char(mi - (level*60))||':'||sc Time from
        select  sum(h) hr,sum(m) mi, sum(s) sc from
            (select
                    substr(t1,1,instr(t1,':',1)-1) h, substr(t1,instr(t1,':',1)+1,instr(t1,':',2)) m, substr(t1,instr(t1,':',3)+1,instr(t1,':',3) - instr(t1,':',2)) s, substr(t1,-2) t
            from c
            union
            select
                    substr(t2,1,instr(t2,':',1)-1), substr(t2,instr(t2,':',1)+1,instr(t2,':',2)), substr(t2,instr(t2,':',3)+1,instr(t2,':',3) - instr(t2,':',2)), substr(t2,-2)
            from c
    connect by level<(mi-60)
    TIME
    8:2:10

  • How to add selected values from table(selected using checkbox)to table?

    Hi All,
    i have created simple page with search panel with table in table i have created one column as check box for selecting.
    here what my requirement is i need to do search multiple times to add some roles to from some different categories.here whenever i searched i ll get some roles into table there i ll select some role and i ll click add buttion. whenever i click add i need to add those roles into some other table finally i ll submit added roles.
    here i followed one link http://www.oracle.com/technetwork/developer-tools/adf/learnmore/99-checkbox-for-delete-in-table-1539659.pdf
    i used same code and able to see selected row in console, as object array how to add these into table.
    please help me out
    Thanks in advance
    siva shankar

    Thank you for a quick reply
    i used the same thing before i go for table check box concept.here what i observed is when i search i am getting some results i am able to shuttle.but if i search again the shuttle is refreshing with new values even not available list its refreshing selected list. IF dont want refresh selected ones.
    my usecase after make some searches I will select some roles from different categories at finally i ll submit.
    i hope you understand me requirement. please suggest me is this requirement is possible in shuttle component? if yes please guide me.
    thanks
    Siva Sankar

  • How to add a value set in a custom form in query_find screen in R12 please

    Hello,I need to add a value set fileld found in the fnd_flex_value_set table in a query find screen . How do I proceed please ?
    Do I create a record group followed by a 'LOV' ?
    Thanks.

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Application Development in PL/SQL » Forms which you can get more quick response
    Regard
    Helios

  • How to add statiscal value in intrastat report for free of charge Pur Order

    Hi Experts,
    In Purchase Order if 'free of charge' check box is ticked then it wont allow us to have condition tab ( as there should not be any pricing for FOC) - SAP Standard functionality.
    But since I want to report this purchase order in Intrastat report, I need to have some statiscal value for this purchase order.
    Can somebody help me how I can add statistical Value to this PO in Intrastat Report ?
    I have already tried following option :
    1) I try to update through user exit but it is again coming as ZERO - Hence not allowing to update.
    2) VEFU-  Manually update the records - Not possible to edit Stats/Invoice Value of PO - Hence ruled out.
    3) Incompletion log - It is showing/ directing me to the PO in change mode but I cannot edit this as there is no condition tab - Hence not possible.
    Can somebody help me ?
    Thanks
    Arpit

    may be you can enetr it in PO header text and extract via z program

  • How to add HEX values in a Report.

    I have a special requirement. I need to add hex values in a report. To be specific, the special HEX characters: 0D 0A 0C 0C, has to be added to TOP of PAGE event.
    Drawing What I want will be something like that:
    CR/LF FF/FFABCDEFHGIJKLMNOZVCXC 
    This is a Report that has to be send to the spool. Once in the spool will be converted to TXT file. I created a small code using print control function but still It is doesn’t working.
    I defined a print control ZPAGE as ‘0D 0A 0C 0C’.
    Any idea how to do this?.
    ** This report doesn’t include the Top-of Page event.
    ** Example Report.
    REPORT  ZCAPRTHEX2 NO STANDARD PAGE HEADING.
    Data: String1(120) type c value 'ABCDEFHGIJKLMNOZVCXC'.
    WRITE : /.
    PRINT-CONTROL FUNCTION 'ZPAGE'.
    WRITE : string1.
    This is what I see in SP01 as HEX View
    ABCDEFHGIJKLMNO ZVCXC #ZPAGE

    If you download spool to file like that, you are still getting the spool in SAP format, it's not going to have the hex chars. You need to print the file by clicking on printer button. SAP generates file in printer readable format and send it to printer. I'm refering to that file.
    Ask your basis folks to write the spool output reqest file to a file instead of sending to the printer. Open that file in hex viewer.
    Regards
    Sridhar

  • How to add new value in operator in search parameter in web ui

    Hi,
    I have a requirement to add values (equal ,not equal ) in operator drop-down field of
    search parameter in search of web ui page.
    Can someone guide me to proceed on this.
    Thanks
    Viren

    Hi,
    here an example how to add operator "contains pattern" to attribute prospect name in the opportunity search.
    Hopefully it will work similar for your issue:
    1) Launch transaction 'sm34'
    2) Enter view cluster name as 'CRMVC_DQ' and click on 'Maintain'
    3) Find DQuery Object Name for example 'BTQOpp' under Comp Name 'BT' and click on'exceptions per attribute.'
    4) Find the Attribute Name for example 'PROSPECT_NAME'
    5) Check the box 'CP' to enable to 'contains' operator.
    Kind regards
    Manfred

  • How to store three values in a suitable data structure?

    Hi Friends!
    Usually, if we want to store a single value we choose vector/set data structure.
    And for two values we prefer map<int, vector<int>> or multimap<int, vector<int>>.
    If I want to store three values like;
    1=>3=>2  4  5
    1=>5=>7
    2=>3=>10  12
    Then, which data structure is suitable for it?
    And how to insert entry into it?
    Could anyone help me?

    You could try   
         typedef vector<int> INTVEC;
         typedef map<int, INTVEC> INTMAP;
         typedef multimap<int, INTMAP> INTMULT;
    You should convince yourself that the above is equivalent to (but hopefully easier to understand)
         typedef multimap<int, map<int, vector<int>>> INTMULT;
    When you try to store values in an object of this type, remember to build it from the inside out:
         Build an INTVEC with the values you want (such as 2 4 5 per your first example).
         Assign that INVEC to an INTMAP with a suitable key (3 in your example).
         Insert that INTMAP into an INTMULT with its appropriate key (1 per your example).
         Repeat these three steps using 7, 5, 1, respectively.
         Repeat again using 10 12, 3, 2, respectively.
    Alternately, you could define a structure like
         struct INTSTRUCT{
              int key;
              vector<int> vec;};
    and then define your multimap as <int, INSTSTRUC>.   This allows you to assign values to both members of a structure object directly and then insert the structure into the multimap with the appropriate key.
    On the other hand, if you change your concept by removing the second => and always put the "second" int as the first element of the vector, as in
         1 => 3 2 4 5
         1 => 5 7
         2 => 3 10 12
    you could simplify things to a multimap<int, vector<int>> you are already familiar with.
    A slightly different concept change to
         1 => 3 => 2 4 5
                  5 => 7
         2 => 3 => 10
    would allow you to use map<int, map<int, vector<int>>> where element [1] of this object contains a map with two elements and element [2] contains a map with a single element.
    Or you could tell us how you intend to use the data and maybe somebody can suggest a more practical approach.
    Yes, I could understand the way you explained as
     typedef multimap<int, map<int, vector<int>>> INTMULT;
    and I used typedef
    multimap<int, map<int, set<int>>> INTMULT;
    but, when I used it, I get,
    1=>3=>2
    1=>3=>4
    1=>3=>5
    1=>5=>7
    2=>3=>10
    2=>3=>12

  • Script task how to add date value

    hi
    i have following code i am trying to add date into script task
     Public Overrides Sub CreateNewOutputRows()
            Dim vars As IDTSVariables100
            Dim vars1 As IDTSVariable100
            Dim recordCount As Integer
            Dim rdate As Date
            ' Dim recount As Integer
            '  Dim rcount As Integer = 0
            'Get the record count
            Me.VariableDispenser.LockOneForRead("RecordCount", vars)
            recordCount = CType(vars("RecordCount").Value, Integer)
            ' rdate = CType(vars("CurentDate").Value, Date)
            vars.Unlock()
            Me.VariableDispenser.LockOneForRead("CurrentDate", vars)
            rdate = CType(vars("CurrrentDate").Value, Date)
            ' rdate = CType(vars("CurentDate").Value, Date)
            vars.Unlock()
            'Me.VariableDispenser.LockOneForRead("rcount", vars)
            'rcount = CType(vars("rcount").Value, Integer)
            'vars.Unlock()
            '  rcount = rcount + 1
            'Output one row with record count
            Output0Buffer.AddRow()
            Output0Buffer.FooterRow = String.Format("ABC" & recordCount & rdate)
            Output0Buffer.SetEndOfRowset()
    in SSIS i have declare CurrentDate in datetime and i need to use it here , but i am getting error.
    how to append its value to       Output0Buffer.FooterRow = String.Format("ABC" & recordCount & rdate)
    its in vb ,i dotn know anything about VB ,please help me.
    i havent put anything in  readonly,readwrite in script task.ecordCount is working but i did same  for rdate and its not working

    how to get that value in yyyymmddhhmmss format in ssis.
    whats expression i need to use.
    also how to give single  space here between recordcount and variables.rdate
    Output0Buffer.FooterRow = String.Format("ABC" & recordCount & Variables.rdate)

  • How to Add Transport Value in TAX CODE

    Hi Experts
    I define the code BED 8 %, Ecess 2 % HEC 1 % & VAT  4% but i want to add Transport value in that TAX CODE.SO could you tell me How to define the Transport Value in these Tax Code.
    Regards
    Amol

    Hi Amol ,
    Pls make the tax code accordingly
    As per your querry
    There are two options in the row level activate the Freight 1 Freight tax , frieght total
    say suppose
    item is X, unit price 100 quantity is 10 then total is 1000 and tax code is BED 16 ecess 1 cess 2 and cst 4% so your total is 1211.39 and if transport charges is 20 and the tax code is same.
    Do make the new Tax Code change in the formula base amt which is your freight amount
    Hope this helps
    Ashish Gupte

  • How to add node value using org.w3c.dom.Document?

    Hi ,
    I'm using org.w3c.dom.Document to deal with xml files. I could successfully add nodes , and their attributes. However I could not add a value of the node. (e.g. <myNode>I couldn't add this value</myNode>)
    does anyone know how to deal with this?
    I tried subNode.setNodeValue("the value i can't add"); whereas the subNode is an instance of org.w3c.dom.Node... i know this is interface i of course used the concrete class
    org.apache.crimson.tree.ElementNode
    but when I used the subNode.getNodeValue() i simply got null?
    can u plz help me?
    thanks in advance

    Reading the API documentation for the Node interface might help. At least you wouldn't be surprised when the results are exactly what the documentation says they will be.
    What would really help would be forgetting the idea that an Element can have a value. Text nodes have values, though, so create a Text node and make it the child of the Element node.

Maybe you are looking for

  • Can't get past payment screen for Apple ID?

    Hello All, I'm a new iPhone user. In my company, we're transitioning from Blackberry to iPhone which I'm responsible for setting up. During the activation process, I have run into an issue with multiple devices where I cannot get past the Apple ID ac

  • How to create waveform diagram for mp3(or other audio file)

    Hi! I googled for several days, but I steel can't solve problem. I need create waveform diagram (in jpeg, png or any other graphics formats) for audio files in console. Waveform diagram look like editor area in sound editors programs. like this  Does

  • Error in the display of values

    Hi friends, I have a problem in the display of values in my report, It displays ### in some columns. But my table has numerical values in it. But it doesn't display it. Why is it so? Help me out.

  • A database error occured. The database error text is: ORA-00932: inconsiste

    Hi Experts, In WebI XI 3.1, i am getting this error when i run webi report against a derived table "A database error occured. The database error text is: ORA-00932: inconsistent datatypes: expected NUMBER got DATE ". The derived table is designed in

  • Can you open Photoshop files in InDesign?

    Is it possible to open a file which is created by Indesign ?