How do I split display Numbers?

I have been given the task of finding the sum, quotient and remainder of two input integers. Not that much of a problem.
But the problem now is, I am supposed to display the digits entered with the numbers being separated by two spaces.
In example, if the number is 5678
the display should be
5 6 7 8
How?
Thank you..

import javax.swing.*;
class Question1 {
     public static void main (String args[]){
          Question1 theObject = new Question1();
          String strA = "";
          String strB = "";
          int a = 0;
          int b = 0;
          int qoutient = 0;
          int remainder = 0;
          for ( ; ;)
          strA = JOptionPane.showInputDialog("Please enter 1st integer : ");
          a = Integer.parseInt(strA);
          if (a==0)
          break;
          strB = JOptionPane.showInputDialog("Please enter 2nd Integer : ");
          b = Integer.parseInt(strB);
          if (b==0)
          break;
          qoutient = a / b;
          remainder = a % b;
          int displayA = displayDigits(a);
          int displayQoutient = displayDigits(qoutient);
          int displayB = displayDigits(b);
          int displayRemainder = displayDigits(remainder);
          JOptionPane.showMessageDialog(null, "The Digit a is "+ displayA + "\nThe Digit B is " + displayB
               +"\nThe quotient is " + displayQoutient + "\nThe Remainder is " + displayRemainder,
               "Digits Displayed", JOptionPane.INFORMATION_MESSAGE);
     }//end main method
     public static int displayDigits(int number){
          int placeValue = number % 10;
        number = number / 10;
        int reverseNumber = 0;
        reverseNumber = reverseNumber * 10 + placeValue;
        return reverseNumber;
}That was how far I Got, but I am reversing numbers instead.
How do I use the charAt method which you recommended?

Similar Messages

  • How can I split these numbers 05/24/2014,"55","15","49","16","28","18","2", pnto different columns?

    How can I split these numbers 05/24/2014,"55","15","49","16","28","18","2", pnto different columns?

    replace:
    with a tab
    copy the text:
    05/24/2014,"55","15","49","16","28","18","2"
    into a text box, then replace the "," with a single tab and replace the ," with a tab, then replace ", with a tab
    then copy, then select a cell, then paste
    05/24/2014,"55","15","49","16","28","18","2"
    ends up looking like:
    05/24/2014     55     15     49     16     28     18     2   (do NOT copy and paste from here... the forum replaces the tabs with spaces... so it won't work)
    when you copy and paste into a table in Numbers it looks like:

  • Using numbers 2.3 how do i split windows to view more than 1 spreadsheet at a time?

    using numbers 2.3 how do i split windows to view more than 1 spreadsheet at a time?

    Hi seth,
    Numbers vocabulary:
    Spreadsheets (aka: Document)
    contain one or more Sheets
    on each of which may be placed one or more Tables
    each of which contains one or more cells
    each of which may contain either data or a formula.
    Spreadsheets open in separate windows. Depending on the contents of each spreadsheet, and the scale at which you want to see it (and the size of your display), you can view more than one spreadsheet in the same manner as you can view more than one of any kind of document—open two documents in separate windows. Resize the windows to allow both to be viewed at the same time. Place and scale the individual documents to permit viewing the desired part of each
    Sheets within the same document cannot be displayed simultaneously. You can make and open a copy of the document, then open and view both copies as described above, but this introduces new opportunities to edit the wrong copy. You could Copy a Table from one part of the document, open Preview and go File > New from Clipboard to create a PDF copy of that table (readable, but not editable), and view the spreadsheet and pdf documents as described above.
    Tables can be rearranged, or have rows or columns (or both) hidden to permit simultaneous viewing of selected parts of both.
    A Table can have Table > Freeze Header Rows and Table > Freeze Header Columns set to keep these rows/columns visible as the rest of the table is scrolled. Or can have a range of rows (or columns) hidden to allow viewing of rows (columns) adjacent to that range visible on the same screen.
    Numbers does not support freezing of rows or columns other than Header rows and Header Columns.
    Regards,
    Barry

  • How to display numbers in triangle format

    Hi All,
    How do I display numbers in the following format;
    1
    1 2
    1 2 3
    1 2 3 4
    Your help will be more appreciated.
    Thank you.

    I couldn't resist:
    SQL> var N number
    SQL> exec :n := 10;
    PL/SQL procedure successfully completed.
    SQL> -- plane
    SQL> select * from (
      2  select lpad(' '||(case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
      3                 then lpad('*',:N*2.5 - level - abs(:N/2-level),'*')
      4      end) --"left wing"
      5      ,50-level, ' ')
      6    || ltrim(sys_connect_by_path(level,' '))
      7    || (case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
      8              then rpad('*',:N*2.5 - level - abs(:N/2-level),'*')
      9      end) -- "right wing"
    10    n
    11  from dual 
    12  connect by level <= :N
    13  order by level);
                                                     1
                                                    1 2
                                                   1 2 3
                              ********************1 2 3 4********************
                             ********************1 2 3 4 5********************
                              ******************1 2 3 4 5 6******************
                                               1 2 3 4 5 6 7
                                              1 2 3 4 5 6 7 8
                                             1 2 3 4 5 6 7 8 9
                                            1 2 3 4 5 6 7 8 9 10
    10 rows selected.
    SQL> exec :n := 6;
    PL/SQL procedure successfully completed.
    SQL> r
      1  select * from (
      2  select lpad(' '||(case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
      3                 then lpad('*',:N*2.5 - level - abs(:N/2-level),'*')
      4      end) --"left wing"
      5      ,50-level, ' ')
      6    || ltrim(sys_connect_by_path(level,' '))
      7    || (case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
      8              then rpad('*',:N*2.5 - level - abs(:N/2-level),'*')
      9      end) -- "right wing"
    10    n
    11  from dual
    12  connect by level <= :N
    13* order by level)
                                                     1
                                                    1 2
                                       ************1 2 3************
                                                  1 2 3 4
                                                 1 2 3 4 5
                                                1 2 3 4 5 6
    6 rows selected.
    SQL>

  • How can I split the video port of an older Mac Mini so I can use both the 922-6199 DVI to RCA, S-Video Adapter and a Cinema Display?

    How can I split the video port of an older Mac Mini so I can use both the 922-6199 DVI to RCA, S-Video Adapter and a Cinema Display?

    Which exact Mini?
    At the Apple Icon at top left>About this Mac.
    Then click on More Info>Hardware and report this upto but not including the Serial#...
    Hardware Overview:
    Model Name: iMac
    Model Identifier: iMac7,1
    Processor Name: Intel Core 2 Duo
    Processor Speed: 2.4 GHz
    Number Of Processors: 1
    Total Number Of Cores: 2
    L2 Cache: 4 MB
    Memory: 6 GB
    Bus Speed: 800 MHz
    Boot ROM Version: IM71.007A.B03
    SMC Version (system): 1.21f4

  • My phone displays numbers instead of contact names for incoming calls and text - how do I fix?

    My phone displays numbers instead of contact names for incoming calls and text - how do I fix?  It used to display the names if there was a contact listed, now it just shows numbers regardless of whether or not the number corresponds to a contact name in the contact list.  Can anyone help?  I googled this problem and lots of folks have experienced it, however there is not a consensus for a resolution.

    Alexandribill, I have been having the exact same issue.  I got a new phone and restored my contacts.  If the # doesn't have the area code first then the name isn't shown.  I just added my husbands area code to my phone and called my phone from his and now his name shows up...Ugh, I have to go through and manually add the area code to all my contacts....
    I'd say Verizon needs to rewrite their program to include the area code in the restoring from backup process!

  • How do I split cells in Numbers 3.2?

    How do I split cells in Numbers 3.2?

    Hey big one,
    I don't believe you can split cells in Numbers 3.2. It has not been not considered a good practice because it can lead to trouble down the line. This is true about merging also. I used to do a lot of that in '09. What I have found that I can generally get the looks I am after (getting text to span multiple columns for instance) by turning off "wrap text in cell" and playing with the justification.
    Hope this is in some way helpful.
    quinn

  • How to split the numbers in as2

    Hi
    I am bit confused on how to split the numbers in as2. Please help

    Without further info, you best bet will probably be to convert the number into a String and extract the characters for whatever purpose you need of them, and convert each back to a Number if that is your ultimate use for them.
    var number = 10;
    for(i=0; i<String(number).length; i++){
        trace(Number(String(number).charAt(i)));

  • Numbers '09 :  How do I split a label in a graph

    How do I split a label in a graph into 2 lines of text. Right now, in the inspector, Axis tab, Category Axis Y, the label is "Asset Value" and shows on 1 line, I want it on 2 lines but there is nothing I can do.
    Is there some sort of code within the label that I have to put?
    Thanks!

    Is this what you want ?
    If it's that, just insert a line break in the header thru option + return.
    Yvan KOENIG (VALLAURIS, France) vendredi 21 janvier 2011 21:02:48

  • How to print continue Line Numbers  in PLD  Differen repetitve areas.

    Hi,
    We need to print line numbers continues in different Repetitive areas.
    Ex. Repetitve Area 0 we have item Discriptions
          Repetitve Area  Footer1 we created sotvalue() here it will display servicetaxes
          Repetitve Area Footer1 we created one text roundoff
    we need output like
    Ex:1. Dell        **Repetitve Area 0****           
          2.Mouse     **Repetitve Area 0****           
          3.Laptop      **Repetitve Area 0****             
          4.servicetax   **Repetitve Area Footer1****           
          5.cess             **Repetitve Area Footer1****           
          6.Hcess             **Repetitve Area Footer1****           
          7.Roundoff           **Repetitve Area Footer1****    as a text field       
      for above all we need to print Line numbers sequence how we can print sequence numbers for differen  areas.if i  assigned Linenum( ) in Repetitve Area 0 it will display one for Repetitve Area 0 only.and i applied Gouplinenum also it's not printing. please guide me how to print this.
    regds,
    sampath kumar devunuri.

    Hi,clint pow.
    Please we did what you said but we are not retreiving data.please tell me how we can get serieal numbers for different repetitve areas.
    regds,
    sampath.

  • How do you split clips in the event viewer in iMovie '11?

    I'm using iMovie '11 and have imported a very long movie (over an hour from VCR Tape) that I want to split into multiple events, however the "Split Clip" option is grayed out. How can I split a large event into smaller events?

    I have discovered a round-about way to split large events from comments in this forum, so apologies, and or thanks to other posters.
    You can split events by deleting (and discarding) a single frame at the point where you want to split the two clips. It's processor intensive (takes a while to do), but it works.
    1.) In the Event Viewer, click to select where you want to split the event.
    2.) Drag the yellow handles to make the selection as small as possible (1 frame?). If you drag the thumbnail display slider to the left to show only 1/2 second intervals, it helps when selecting a single frame.
    3.) Right click and select "Reject Selection". The clip is now split.
    4.) When you've completed all of your clip splitting, select "Show: Rejected Only" at the bottom of the Event Viewer to show all of the rejected frames.
    5.) Click on "Move Rejected to Trash". This operation could take a while.
    That should be it.
    Hope this helps.

  • How do I close a numbers document without closing the entire app?

    Can anyone tell me how I can close a numbers document without closing the entire app? i.e. go back to the folders display page - is this even possible?

    It is not a bug, but a new feature.<br />
    Some menu entries in the main menu bar are hidden if you use the mouse and only appear if you use the keyboard to open the menu (Bug 626825).
    You can see the difference if you use Alt+F to open the File menu or other menus like the Edit menu (Alt+E) and Bookmarks menu (Alt+B) and compare that to what you see if you use the mouse to open the menu after you have made the menu bar visible by tapping Alt or by pressing F10.
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=626825 bug 626825] - Hide redundant menu commands unless the user invokes the menu using the keyboard (make use of the openedWithKey attribute)
    ''(please do not comment in bug reports; you can vote instead)''
    See also:
    * [[/questions/799856#answer-155765]]

  • How to set to display  rows no. in source program

    how to set to display  rows no. in source program ?

    Hi,
    If u r working in 4.5B or older then u ll get it automatically.
    If u want to get numbering in 4.7 or ECC u just do this.
    Utilities -> settings -> ABAP editor
    Then u can select new editor or lod and u can find lot of options there.
    Regards,
    Subbu

  • How can I split a header in two columns?

    Hello, for the past hour I've been trying to figure out how can I split/divide a header or footer in to two columns and then align text in the left collumn to left and the text in the right column to right.
    For example:
    | Header length                                                                                                   |
    | Left Align                                           |                                           Right Align |
    The only solution I have found was adding a table to the header, but it has some weird padding underneath it, which completely screws up its position in the footer.
    Anyway, I hope this makes sense and someone here knows how to do this.
    I really appriciate you reading this and am looking forward to your replies,
    James.

    You don't need a table.
    Menu > View > Show Ruler
    Leave the header left aligned and click on the ruler to create a Centred tab (if required) in the middle and a right hand tab to the right. You change the tabs by right clicking on them and choosing the orientation.
    Then enter your text:
    Left Text [tab] Centre Text (optional) [tab] Right Text
    With Facing pages you can set the Left and Right pages to be different to allow the Page numbers to the outside or inside of the spread.
    Peter

  • U410 Windows 8 how do you split the screen in two?

    I have an IdeaPad U410 with Windows 8 as an Operating system. I would like to know how do you split the screen in two. Also I would like to know if I can put my screen as a touch?
    Moderator Note; subject edited for relevancy

    hi BoJ,
    Welcome to the Lenovo Forums.
    If you're referring to having an extended display , you will need to have an external monitor and enable extended mode by pressing the Winkey+P and select Extend.
    If you want to split the screen to work with 2 documents or 2 windows at a time, you can snap the windows by pressing Winkey+ Left or Right arrow - check this article in reference.
    Hope this helps
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

Maybe you are looking for

  • I just downloaded ios 6 on my ipad, and i cant find siri anywhere

    i downloaded ios 6 just now and when i go through the process it didnt give me an option for siri. and afterwards when i go to my setting and into general there is nothing related to siri there... can anyone tell me whats wrong?

  • Loss of "Themes" in iphoto 09

    Hi guys From the outset Im letting you know that Im no computer expert or wizz. Im just a guy trying to keep up to date. And after reading all this IM starting to feel really dumb. Anyways im in a world of bother and its been driving me mad for the l

  • How to Fix the following Encore Error: "Quick Time system error: number = -1"?

    Has anyone seen this error before in Encore? Quick Time system error: number = -1 How do you fix it? I get it while burning a DVD. I have the latest version of Encore and the menu I am using was exported from After Effects. Thanks so much, Heather

  • Smartforms - urgent ~ pls help

    Hi,   I have a question on the smartforms.   I need to create a cover page & content page. In the Cover page's Main window, I added a template because data is only displayed once and it is static.   As for the Content Page, I have 1 template & 1 tabl

  • Mechanism for inclusion of photos in iPhoto Library file

    in addition to the 'iPhoto Library' file contained my 'Pictures' folder there are other folders and files here containing more photos. But how do these get to be included into iPhoto Library and how? It seemed to me that iPhoto Library automatically