Is the Output shown in JLS 1.0 wrong ?

This is the code example given in the section [Assignment Conversion|http://java.sun.com/docs/books/jls/first_edition/html/5.doc.html#170768]
of Java Language Specification 1.0
class Test {
     public static void main(String[] args) {
          short s = 12;                                   // narrow 12 to short
          float f = s;                                   // widen short to float
          System.out.println("f=" + f);
          char c = '\u0123';
          long l = c;                                   // widen char to long
          System.out.println("l=0x" + Long.toString(l,16));
          f = 1.23f;
          double d = f;                                   // widen float to double
          System.out.println("d=" + d);
}On the web the Output shown is :
f=12.0     
i=0x123
d=1.2300000190734863which is wrong since , i =0x123,"i" is never printed but the O/P should be :
f=12.0
l=0x123
d=1.2300000190734863If this is a error ,has it been notified earlier ,if not what can be done ?
Thank you for your consideration.
Edited by: amtidumpti on May 6, 2009 6:36 PM

amtidumpti wrote:
jverd wrote:
amtidumpti wrote:
I was comparing all the versions specifications when i found this error.This has been displayed correctly in Version 2.0 and 3.0 respectively.Then if it's correct in 2.0 (which is obsolete) and 3.0 (which is current), who cares if it's wrong in 1.0 (which is WAY obsolete)?Ya,doesn't seem anyone cares,otherwise would have been fixed in Version 1.0 also.Not necessarily. It might not have been noticed. Or people may have cared, but not enough to delay the publishing. All software has bugs, including bugs that the creators know about and have chosen not to fix, and bugs that the creators are unaware of at the time of release. I suspect the same is true of publications.

Similar Messages

  • How to get the output of a background report to be shown on the screen

    When we run the background process it goes to spool request. my requirement is to show it on the screen may be after some time to the user. how can we do that. Thanks in advance

    Hello Varun,
    You cqan submit the report as a JOB and export the out put to memory, once the job is complete you can read the list to display the output.
    Cheers,
    Mano
    Cut & Paste form SAP help.
    Submit report ....
    EXPORTING LIST TO MEMORY
    Does not display the output list of the called report, but saves it in ABAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. In addition, you must not assign a function code to the ENTER key in the current GUI status. The saved list is read from the SAP memory using the function module 'LIST_FROM_MEMORY' and can then be saved to the database using EXPORT, for example. You can process this list further with the function modules 'WRITE_LIST', 'DISPLAY_LIST' ... of the function group "SLST".

  • Output shown in Design view of Dreamweaver CS6 is not same as shown by the browsers

    I have made a yoga website http://ballychohan.co/ in Dreamweaver CS6. I faced this problem while designing the website.The results shown by Design view in Dreamweaver is not correct. It made me very confused at the starting. Please tell me how to overcome this problem of DreamWeaver. Should I install a lower version of Dreamweaver ?

    Bally Chohan wrote:
    I have made a yoga website http://ballychohan.co/ in Dreamweaver CS6. I faced this problem while designing the website.The results shown by Design view in Dreamweaver is not correct. It made me very confused at the starting. Please tell me how to overcome this problem of DreamWeaver. Should I install a lower version of Dreamweaver ?
    Does the page show correctly in a browser?
    Dreamweaver design view is not very reliable  at renedering designs exactly the way you want them to look, especailly if you use more of the complex and up-to-date css, now available. Dreamweaver is always playing catch-up in that area.

  • XSLT Mapping: URI appearing in each field entry in the output

    Hi there,
    I am mapping a custome build Invoice to xCBL structure in Stylus Studio. The output look ok, but in each field URI value appear as well, as shown below.
    --Start
    <p:msgDetails xmlns:p="http://localhost/webs/msgDetails.xsd">
    <p:sender xmlns:p="http://localhost/webs/msgDetails.xsd"><p:senderId xmlns:p="http://localhost/webs/msgDetails.xsd">SCA HA</p:senderId><p:senderName xmlns:p="http://localhost/webs/msgDetails.xsd">SCA HA</p:senderName></p:sender><p:receiver xmlns:p="http://localhost/webs/msgDetails.xsd"><p:receiverId xmlns:p="http://localhost/webs/msgDetails.xsd">PEL</p:receiverId><p:receiverName xmlns:p="http://localhost/webs/msgDetails.xsd">Progressive Enterprise</p:receiverName></p:receiver><p:docType xmlns:p="http://localhost/webs/msgDetails.xsd">invoice</p:docType><p:docFormat xmlns:p="http://localhost/webs/msgDetails.xsd">xcbl40</p:docFormat><p:transmissionDetails xmlns:p="http://localhost/webs/msgDetails.xsd"><p:testMsg xmlns:p="http://localhost/webs/msgDetails.xsd">true</p:testMsg><p:transmissionDate xmlns:p="http://localhost/webs/msgDetails.xsd">2005-05-23 14:20:20</p:transmissionDate><p:messageId xmlns:p="http://localhost/webs/msgDetails.xsd">2005-05-23 14:20:20</p:messageId><p:username xmlns:p="http://localhost/webs/msgDetails.xsd"/><p:password xmlns:p="http://localhost/webs/msgDetails.xsd"/></p:transmissionDetails></p:msgDetails>
    ---End
    The expected output is,
    - Start
    <p:msgDetails xmlns:p="http://localhost/webs/msgDetails.xsd">
      <p:sender>
        <p:senderId>SCA HA</p:senderId>
        <p:senderName>SCA HA</p:senderName>
      </p:sender>
      <p:receiver>
        <p:receiverId>PEL</p:receiverId>
        <p:receiverName>Progressive Enterprises</p:receiverName>
      </p:receiver>
      <p:docType>invoice</p:docType>
      <p:docFormat>xcbl40</p:docFormat>
      <p:transmissionDetails>
        <p:environmentFrom>dev</p:environmentFrom>
        <p:testMsg>true</p:testMsg>
        <p:transmissionDate>2005-05-18T11:14:06</p:transmissionDate>
        <p:messageId>104435_2005-05-18T11:14:06</p:messageId>
        <p:username></p:username>
        <p:password></p:password>
      </p:transmissionDetails>
    </p:msgDetails>
    --end
    Its happening in the body area as well. Can somebody please suggest.
    Thank you.
    Warm Regards,
    Ranjan

    Hi Ranjan,
    You can resolve this in this way.
    In ur xsl, delete the namespaces appearing. Then hardcode with ur hand the namespace like <p:msgDetails xmlns:p="http://localhost/webs/msgDetails.xsd">.
    Make sure that the template match is coming before the
    <p:msgDetails ..
    Hope this helps out.
    Rgds,
    Deno

  • Can not see Characteristics fields in the output option of VC

    Hello,
    Any body know why is the characteristic fields of a BW query shows only in the input parameter and not shown in the output option when we model BW query in VC?
    Regards,
    Maureen

    Hi Maureen,
    right click on query "Test data service" then excute the query and click on generate.
    Best Regards,
    Marcel

  • Need help to draw a graph from the output I get with my program please

    Hi all,
    I please need help with this program, I need to display the amount of money over the years (which the user has to enter via the textfields supplied)
    on a graph, I'm not sure what to do further with my program, but I have created a test with a System.out.println() method just to see if I get the correct output and it looks fine.
    My question is, how do I get the input that was entered by the user (the initial deposit amount as well as the number of years) and using these to draw up the graph? (I used a button for the user to click after he/she has entered both the deposit and year values to draw the graph but I don't know how to get this to work?)
    Please help me.
    The output that I got looked liked this: (just for a test!) - basically this kind of output must be shown on the graph...
    The initial deposit made was: 200.0
    After year: 1        Amount is:  210.00
    After year: 2        Amount is:  220.50
    After year: 3        Amount is:  231.53
    After year: 4        Amount is:  243.10
    After year: 5        Amount is:  255.26
    After year: 6        Amount is:  268.02
    After year: 7        Amount is:  281.42
    After year: 8        Amount is:  295.49
    After year: 9        Amount is:  310.27
    After year: 10        Amount is:  325.78
    After year: 11        Amount is:  342.07
    After year: 12        Amount is:  359.17
    After year: 13        Amount is:  377.13
    After year: 14        Amount is:  395.99
    After year: 15        Amount is:  415.79
    After year: 16        Amount is:  436.57
    After year: 17        Amount is:  458.40And here is my code that Iv'e done so far:
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.lang.Math;
    import java.text.DecimalFormat;
    public class CompoundInterestProgram extends JFrame implements ActionListener {
        JLabel amountLabel = new JLabel("Please enter the initial deposit amount:");
        JTextField amountText = new JTextField(5);
        JLabel yearsLabel = new JLabel("Please enter the numbers of years:");
        JTextField yearstext = new JTextField(5);
        JButton drawButton = new JButton("Draw Graph");
        public CompoundInterestProgram() {
            super("Compound Interest Program");
            setSize(500, 500);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            amountText.addActionListener(this);
            yearstext.addActionListener(this);
            JPanel panel = new JPanel();
            panel.setBackground(Color.white);
            panel.add(amountLabel);
            amountLabel.setToolTipText("Range of deposit must be 20 - 200!");
            panel.add(amountText);
            panel.add(yearsLabel);
            yearsLabel.setToolTipText("Range of years must be 1 - 25!");
            panel.add(yearstext);
            panel.add(drawButton);
            add(panel);
            setVisible(true);
            public static void main(String[] args) {
                 DecimalFormat dec2 = new DecimalFormat( "0.00" );
                CompoundInterestProgram cip1 = new CompoundInterestProgram();
                JFrame f = new JFrame();
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.getContentPane().add(new GraphPanel());
                f.setSize(500, 500);
                f.setLocation(200,200);
                f.setVisible(true);
                Account a = new Account(200);
                System.out.println("The initial deposit made was: " + a.getBalance() + "\n");
                for (int year = 1; year <= 17; year++) {
                      System.out.println("After year: " + year + "   \t" + "Amount is:  " + dec2.format(a.getBalance() + a.calcInterest(year)));
              @Override
              public void actionPerformed(ActionEvent arg0) {
                   // TODO Auto-generated method stub
    class Account {
        double balance = 0;
        double interest = 0.05;
        public Account() {
             balance = 0;
             interest = 0.05;
        public Account(int deposit) {
             balance = deposit;
             interest = 0.05;
        public double calcInterest(int year) {
               return  balance * Math.pow((1 + interest), year) - balance;
        public double getBalance() {
              return balance;
    class GraphPanel extends JPanel {
        public GraphPanel() {
        public void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setColor(Color.red);
    }Your help would be much appreciated.
    Thanks in advance.

    watertownjordan wrote:
    http://www.jgraph.com/jgraph.html
    The above is also good.Sorry but you need to look a bit more closely at URLs that you cite. What the OP wants is a chart (as in X against Y) not a graph (as in links and nodes) . 'jgraph' deals with links and nodes.
    The best free charting library that I know of is JFreeChart from www.jfree.org.

  • Is it possible to display a tag at the selection screen in the output.

    Hi all,
       When you go to se38 and in the program editor screen, at the bottom right end of the screen you find a value called NUM and when you place your cursor on that it displays a tag that says "Num Lock Mode. Double click to toggle."
       My query is, when i execute a report it takes me to the output screen that has a parameter, here i want to display a tag, say "enter the record as it is in the database". Is it possible to have such an option.
       If you'll are wondering why I'm looking for such an option it is just to make a report that can be understood by many.
    P.S: Not only on the NUM field the tag is available. Even on tools like activate display and so on.
    Regards,
    Narayanan Chandran.

    If it's a report program, use a comment in the selcetion screen for information of the user as shown below.
    * Information
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-003.
    SELECTION-SCREEN COMMENT /1(60) text-004. "Text containing the information message
    SELECTION-SCREEN END OF BLOCK b1.
    If you are using a module pool, you can create a tooltip for the element as suggested.

  • Output shown blank when we run report in xml publisher using excel template

    Hi,
    1) We have a requirement where we need to run report to shown 100 columns. Since Microsoft word supports only 63 columns. So we are building the report template in Excel.
    2) When I run the report in Excel locally I get the output. But when I uplaod in BIP server and then run the report It gives a blank output.
    BI Publisher version 10.1.3.4.1
    BI Publisher Desktop version 11.1.1.5
    Please look into the issue.
    Please help
    Thanks,
    Nita

    Pl post details of OS, database and EBS versions, along with the database characterset.
    Are you creating PDF output ? Can you print Chinese characters when using US/UK operating units ? Are you using Pasta ?
    How to Generate PDF Output With UTF8 in R12? [ID 778970.1]
    HTH
    Srini

  • How to remove truncation in the output of ps -ef command in solaris

    Hi,
    One silly question but i m unable to find solution.
    In solaris-10 when i executed the command ps -ef some datas in the output in the command column is truncated as below
    UID PID PPID C STIME TTY TIME CMD
    root 6811 1 0 19:33:36 pts/3 0:00 sh /export/home/bti/bti/Revathi/BTI/EMS/bin/startemsserver.sh
    root 6827 6819 0 19:33:37 pts/3 2:33 /export/home/bti/bti/Revathi/BTI/EMS/jre/bin/java -DJBOSS_HOME=/export/home/bti
    Where in the CMD column the path */export/home/bti/bti/Revathi/BTI/EMS/jre/bin/java -DJBOSS_HOME=/export/home/bti* continues. Only half of the path is shown. I need the entire path how to achieve it
    Regards
    Revathi

    Just to make things a little more complex...
    /usr/ucb/ps (actually /usr/ucb/sparcv9/ps) used to be SUID root so that it could read the full args directly out of the address space of the process (/proc/<pid>/as).
    Sun removed this behavior in Solaris 8 with patch 109023-05 and in Solaris 9 with patch 120240-01 (it's been removed from Solaris 10 since FCS)

  • Display empty fields in between the output, urgent

    hi
    i need to display some empty fields in the output txt file, in between teh normal database fields i am displaying
    for eg if first field is f1 (1-10)
    second is f2 (11-35)
    third field is empty i need todisplay as (12-45)
    and again f4 as (13-60) so on
    such there are multiple fields in between dattabase field which just needs to be displayed as empty only and all fields should be seperated by space as showni above eg
    regards
    arora

    closed got solution

  • Problem in the output of J1INQEFILE

    Dear All,
    I am facing a problem to capture the WHT amount in J1INQEFILE.
    I m working on 4.7.
    we have seperate tax types & seperate tax codes for every section code. WHT cycle is working fine till J1INQEFILE, which is a eTDS returs. System is giving me the total amount of TDS deducted for every vendor, which is shown as per the every document. If i drill down from the report i can see the document entry.
    But the standard SAP report have columns for TDS, surcharge & Ecess.
    When I execute the J1NQEFILE, The TDS column is capturing the values of
    TDS Base amount + S. Ecess
    and the Surcharge of 10% and the ECess of 2% is calculating Perfectly.
    I have also applied note no: 1097621, yet the problem is persisting.
    The OUTPUT I want to have is the
    TDS Column to show just the TDS base amount only
    and the
    E Cess column to show the E. Cess + S. Ecess
    and
    Surcharge remaining unchanged
    What changes do I need to do further to pull the desired output
    Thanks & Advance,
    ABAPer

    refer to sap note: 984623, from the above note pick notes relvevant for version 4.7
    Ur problem will be resolved.

  • Want to display a space after last field in the output txt file

    hi
    I want to display a space after last field in the output txt file which is generaed by my program on utility server the last field lengyt we have defined is four and in database it is of three characters and requirement is to disppaly the last fourth field as space in the output file w hich is not shown as the txt file automatically gets closed at the third place as it is the last field in the record and ind atabase records are of therss char only but user wants to display this fourth position in the notepad output file as space ( which is last field in the output file)
    eg
    name house  street country
    record output coming in file
    ram   h3      street3  thn      now this thn which is last field the notepad get closed at thn only
    i want to display one space in last field for the whole of output file
    ie ram      h3   street3  thn(space)
        sham   h4  street4   sgp(space)  so on......
    we need to show this space in the output file as blank
    regards
    Arora

    hi Atish
    i am using
    loop at gt_sagadr_outtab into wa_sagadr_outtab
    move wa_sagadr_outtab-country to wa_sagadr_text+223(226).
    endloop
    in this last field ie country i need to display the last 226 as blank as only country key is two char in database so the last space is not shown
    i am not unsing the fM as tolb by  you
    and afterwards
    i am usning
    Concatenate 'Sagadr_' sy-datum sy-uzeit '.dat' into gv_filename_sagadr.
    CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
      CLIENT                        = SY-MANDT
        LOGICAL_FILENAME              = gc_lfile
        OPERATING_SYSTEM              = SY-OPSYS
        PARAMETER_1                   = gc_param1
        PARAMETER_2                   = gc_send
        PARAMETER_3                   = gv_filename_sagadr
      USE_PRESENTATION_SERVER       = ' '
      WITH_FILE_EXTENSION           = ' '
      USE_BUFFER                    = ' '
      ELEMINATE_BLANKS              = 'X'
      IMPORTING
      EMERGENCY_FLAG                =
      FILE_FORMAT                   =
        FILE_NAME                     =  gv_filepath_sagadr
    EXCEPTIONS
      FILE_NOT_FOUND                = 1
      OTHERS                        = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    and lastly
    open dataset gv_filepath_sagadr for output in text mode encoding default.
        if sy-subrc eq 0.
         loop at gt_sagadr_text into wa_sagadr_text.
         transfer wa_sagadr_text to gv_filepath_sagadr.
         endloop.
        endif.
       close dataset gv_filepath_sagadr.
        if sy-subrc = 0.
        message S002 with gv_filepath_sagadr. "Files & created on Application server
        endif.
    SO NOT SURE WHERE TO USE THE CODE AND HOW

  • Generated Pulse waveform is distorted when I deliver the signal to the output port in the DAQmx

    Problem: Generated Pulse waveform is distorted when I deliver the signal to the output port in the DAQmx.
    Environment: Windows XP sp3 (32bit), Visual Studio 2010 sp1, NI-Measurement Studio 2010
    Device: NI - DAQmx PCI 6251
     Analog Input: 1.00MS/s multi-channel (aggregate)
     Analog Output: 2 Channel 2.00MS/s
    Reference Example: AO_ContGenVoltageWfm_IntClk / AI_ContAcqVoltageSamples_IntClk
    Generated Pulse:
    1) AO0 = Square Waveform /0-5V / 8KHz / 0.5㎲/sample / sample 50% Duty
    2) AO1 = Square Waveform /0-5V / 8KHz / 0.5㎲/sample / (Reverse Image)
    Description: I’d like to deliver the waveform stream satisfied with specified constraints to the 2 channel output port in the DAQmx. To verify accuracy of the generated waveform, I did an electrical wiring from the Analog output channel (2 channels) to the Analog Input channel (2 channels) in DAQmx. As a result of this experiment, I could get a result which has signal distortion. Since the waveform has to satisfy with both high frequency (8KHz) and very short moment interval time (△t = 0.5㎲/sample) between samples, I cannot handle some parameters of the function in the referenced VC++ example. Following formulas shows an approach to deliver the generate pulse waveform to output port satisfied with constraints.
    Analog Output Channel
     Frequency = 8,000 cycles/sec (constraint)
     Sample per Buffer = 2,000,000 = 2*106 samples/buffer
     Cycles per Buffer = 80,000 cycles/buffer
     Sample per Channel = 1,000,000 = 1*106 samples/channel
     Sample Rate  = Frequency * (Sample per Buffer / Cycle per Buffer)
                              = 8,000 * (2*106 / 80,000) = 2*106 samples / sec
     △t  = 1 sec / 2*106 samples / sec
               = 0.5 * 10-6 sec/sample (constraint)
     Buffer Cycle  = Sample Rate / Sample per Channel
                              = (2*106 samples / sec) / (1*106 samples/channel)
                              = 2 channel / sec
    Analog Input Channel
    Sample per Channel = 1,000,000 = 1*106 samples/channel
     Sample Rate  = 1 MS/s * (2 Channel) = 5 * 105 Samples / Sec
    Program Code
    AO_ContGenVoltageWfm_IntClk / AI_ContAcqVoltageSamples_IntClk (VC++ Example)
    Result: The proposed approach was implemented in the experiment environment (VS2010, MStudio2010). As shown in Figure 1, we could get the unsatisfied result. Although I intended to make a ‘square’ pulse wave, the result looks like ‘trapezoid’ pulse wave (Figure.1). However, there is other result which was undertaken with different parameter condition. It looks like the square shape not the trapezoid shape.
    Please let me know what the conditions make the problem of signal distortion. (AO0 = Green line / AO1 = Red line)
    [Figure. 1] Frequency 8000 Hz / Cycle per Buffer = 8000 Result
    [Figure. 2] Frequency 1000 Hz / Cycle per Buffer = 1000 Result
    Questions: Please let me know following questions.
    1) Is it possible to deliver the generated pulse wave satisfied with constraints (f= 8KHz), △t = 0.5㎲/sample) to the output port without distortion using PXI 6251?
    (Is it possible to solve the problem, if I use the LabView or MAX?)
    2) Are there some mistakes in the proposed approach? (H/W or S/W program)
    3) What is the meaning of the Cycle per Buffer?, It could effect to the result?

    Hi Brett Burger,
    Thanks for your reply. For your information, I have set the sampling rate as 10000 as for the sound format, I have set the bits per sample as 16 bit, the rate as 11025 and the sound quality as mono. I tried using your method by changing the sampling rate as 8K but still my program encounter the same problem.
    I wish to also create a button that is able to generate a preformatted report that contains VI documentation, data the VI returns, and report properties, such as the author, company, and number of pages only when I click on the button.  I have created this in my program, but I am not sure why is it not working. Can you help troubleshoot my program. Or do you have any samples to provide me. Hope to hear from you soon.
    Many thanks.
    Regards,
    min
    Attachments:
    Heart Sounds1.vi ‏971 KB

  • How can one counter be sources (or gated) with the output of the other?

    I'm trying to use the counters to generate a square pulse train that contains a certain number of pulses (on 6036E). For that I need to gate counter0 with the output of counter1. The manual seems to indicate that I need to use
    GPCTR_Change_Parameter (deviceNumber, ND_COUNTER_0, ND_GATE, ND_COUNTER_1) ,
    however it makes no difference to the output; I see no gating. What am I doing wrong? Am I missing something?
    I would also like to source counter1 with the output of counter0. There's a similar function call to choose the source signal, but so far I've been unable to source a counter with anything but the internal timer.  I guess the reason for it might be the same as the gating problem.
    Petro

    Hi Petro-
    This example shows how to output a finite gated pulse train on an E Series board.  It mentions that it is a CVI example, but the main .c file does not include any CVI-specific functionality so it should work if you're using ANSI C.
    Equivalent functionality is available in NI-DAQmx for your board and is considerably more intuitive.  An example of pause-triggered pulse train generation is available in the "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Generate Pulse\Dig Pulse Train Cont-Pause Trig" directory of your local drive.  One method to generate the "pause trigger" pulse train is shown in "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Generate Pulse\Dig Pulse Train-Cont" .
    I'm not sure what you mean when you say "I would also like to source counter1 with the output of counter0."  What do you need to perform this operation for?  The reliance of counter 1 on counter 0 and counter 0 on counter 1 creates a type of circular reference that is almost guaranteed to be problematic.
    Hopefully this helps-
    Tom W
    National Instruments

  • Errors in the output/result..

    I tried to compile the program that should display the following side by side_:
    Miles           Kilometers          Kilometers           Miles
    1               1.609               201                  124.922
    2               3.218               202                  125.544
    3               4.827               203                  126.165
    4               6.436               204                  126.787
    5               8.045               205                  127.408However, the wrong output is shown as below:
    Miles           Kilometers          Kilometers           Miles
    1               1.609               201                  124.922
    1               1.609               202                  125.544
    1               1.609               203                  126.165
    1               1.609               204                  126.787
    1               1.609               205                  127.408
    2               3.218               201                  124.922
    2               3.218               202                  125.544
    2               3.218               203                  126.165
    2               3.218               204                  126.787
    2               3.218               205                  127.408
    3               4.827               201                  124.922
    3               4.827               202                  125.544
    3               4.827               203                  126.165
    3               4.827               204                  126.787
    3               8.045               205                  127.408
    4               6.436               201                  124.922
    4               6.436               202                  125.544
    4               6.436               203                  126.165
    4               6.436               204                  126.787
    4               6.436               205                  127.408
    5               8.045               201                  124.922
    5               8.045               202                  125.544
    5               8.045               203                  126.165
    5               8.045               204                  126.787
    5               8.045               205                  127.408I need your help to check and correct the mistakes. Thanks a lot.
    What I compiled the program is shown as below:
    import java.util.Scanner;
    public class TwinConvTable
       public static void main(String[] args)
          //display the names
          System.out.println("Miles\tKilometers\t\tKilometers\tMiles");
          for (int m=1; m<=5; m++)
          for (int km=201; km<=205; km++)
             //display the output
             System.out.println(m + "\t\t" + (m*1.609) + "\t\t\t" + km + "\t\t" + (km/1.609));
       }//end of main
    }//end of Twin1 classNote:
    km = (m*1.609)
    m = (km/1.609)
    Edited by: soulhealer88 on May 25, 2008 12:01 PM
    Edited by: soulhealer88 on May 25, 2008 12:09 PM

    Sorry for replying late.
    I realised that I forgot to use the brackets { } to close the loop body.
    Thanks a lot for helping and correcting.
    **Readers, I wonder whether you want to use the program compilation. Here is below:
    public class TwinConvTable
         public static void main(String[] args)
              //display the names
              System.out.println("Miles\tKilometers\t\tKilometers\tMiles");
              int miles=0;
              for (int kilometers=201; kilometers<=205; kilometers++)
              //loop body
                   miles++;
                   //display the output
                   System.out.printf(miles + "\t\t" + (miles*1.609) + "\t\t\t" + kilometers + "\t\t" + "%.3f\n",(kilometers/1.609));
              }//end of for loop
         }//end of main
    }//end of TwinConvTable classEdited by: soulhealer88 on May 25, 2008 11:08 PM

Maybe you are looking for

  • What to get for University? Please Help!

    Hello all! Alright, well. I am just about to start my last year in highschool before I'm off to university, and of course, I'm going to need a laptop. I currently have a HP G62. Thinking it would be alright, however the battery life is terrible. (So

  • Supporting BW 3.5 and BI 7.0 Web Reports in NW04s Portal

    Hi All, I have been able to identify any documentation confirming that web reports from both BW 3.5 and BI 7.0 can be supported within the same portal.  Can someone please point me to documentation supporting this solution?  Or, provide me with furth

  • Blackberry curve 9360

    I cannot get this device to save any downloads or upgrades. It just auto reboots back to the way it was. HELP! Solved! Go to Solution.

  • SMTP scripted kal fails on Exch 5.5 after upgrade from NT4 to Win2K

    Over the last three weeks the messaging group within my company has upgraded the OS on three of the four Exchange 5.5 server from NT4 to Win2K. After each of the upgrades the standard smtp kal script stops working with an error of Script error in lin

  • Adobe photoshop & illustrator cc run slowly on yosemite

    Anyone help me im use ps and ai cc(uptodate) but run so slowly my machine : OS : 10.10 yosemite IMac Intel Quad Core i5 3.5Ghz (MF886)  Memory 8Ghz Harddisk 1 Terra Display 27" TFT, Mavericks Vga Card Retina 5K Display AMD RAD with 2Gb best regards