Who can help me? write this code?

Write java code print prime number like this
Sample Screen Print:
Initial matrix with N = 37
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37
Intermediate results (after 1st iteration)
2 3 5 7 9
11 13 15 17 19
21 23 25 27 29
31 33 35 37
Intermediate results (after 2nd iteration)
2 3 5 7
11 13 17 19
23 25 29
31 35 37
Intermediate results (after 7th iteration)
2 3 5 7
11 13 17 19
23 29
31 37
Final results
2 3 5 7 11 13 17 19 23 29
31 37
How to write this code ?
Please Help me!
Thank you so muchhh ?????

Looks like The Sieve of Eratosthenes.
A google search for that should help you with some logic.
Wikipedia has a really nice animation of how it works.
Post back when you have some source code that you need help with.
Thanks k???? lullzz???

Similar Messages

  • Who can help me write this Java code show the prime number ???? PLEASEEEEEE

    Write java code print prime number like this
    Sample Screen Print:
    Initial matrix with N = 37
    2 3 4 5 6 7 8 9 10
    11 12 13 14 15 16 17 18 19 20
    21 22 23 24 25 26 27 28 29 30
    31 32 33 34 35 36 37
    Intermediate results (after 1st iteration)
    2 3 5 7 9
    11 13 15 17 19
    21 23 25 27 29
    31 33 35 37
    Intermediate results (after 2nd iteration)
    2 3 5 7
    11 13 17 19
    23 25 29
    31 35 37
    Intermediate results (after 7th iteration)
    2 3 5 7
    11 13 17 19
    23 29
    31 37
    Final results
    2 3 5 7 11 13 17 19 23 29
    31 37
    How to write this code ?
    Please Help me!
    Thank you so muchhh ?????

    h2. {color:#ff0000}Multiplepost{color}
    Replies here: http://forum.java.sun.com/thread.jspa?threadID=5241012&tstart=0
    There is a useful answer the original thread. Answer it, or ignore it as you like, but don't create multiple threads.

  • I will pay for who can help me with this applet

    Hi!, sorry for my english, im spanish.
    I have a big problem with an applet:
    I�ve make an applet that sends files to a FTP Server with a progress bar.
    Its works fine on my IDE (JBuilder 9), but when I load into Internet Explorer (signed applet) it crash. The applet seems like blocked: it show the screen of java loading and dont show the progress bar, but it send the archives to the FTP server while shows the java loading screen.
    I will pay with a domain or with paypal to anyone who can help me with this problematic applet. I will give my code and the goal is only repair the applet. Only that.
    My email: [email protected]
    thanks in advance.
    adios!

    thaks for yours anwswers..
    harmmeijer: the applet is signed ok, I dont think that is the problem...
    itchyscratchy: the server calls are made from start() method. The applet is crashed during its sending files to FTP server, when finish, the applet look ok.
    The class I use is FtpBean: http://www.geocities.com/SiliconValley/Code/9129/javabean/ftpbean/
    (I test too with apache commons-net, and the same effect...)
    The ftp is Filezilla in localhost.
    This is the code, I explain a little:
    The start() method calls iniciar() method where its is defined the array of files to upload, and connect to ftp server. The for loop on every element of array and uploads a file on subirFichero() method.
    Basicaly its this.
    The HTML code is:
    <applet
           codebase = "."
           code     = "revelado.Upload.class"
           archive  = "revelado.jar"
           name     = "Revelado"
           width    = "750"
           height   = "415"
           hspace   = "0"
           vspace   = "0"
           align    = "middle"
         >
         <PARAM NAME="usern" VALUE="username">
         </applet>
    package revelado;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import java.io.*;
    import javax.swing.border.*;
    import java.net.*;
    import ftp.*;
    public class Upload
        extends Applet {
      private boolean isStandalone = false;
      JPanel jPanel1 = new JPanel();
      JLabel jLabel1 = new JLabel();
      JLabel jlmensaje = new JLabel();
      JLabel jlarchivo = new JLabel();
      TitledBorder titledBorder1;
      TitledBorder titledBorder2;
      //mis variables
      String DIRECTORIOHOME = System.getProperty("user.home");
      String[] fotos_sel = new String[1000]; //array of selected images
      int[] indice_tamano = new int[1000]; //array of sizes
      int[] indice_cantidad = new int[1000]; //array of quantitys
      int num_fotos_sel = 0; //number of selected images
      double importe = 0; //total prize
      double[] precios_tam = {
          0.12, 0.39, 0.60, 1.50};
      //prizes
      String server = "localhost";
      String username = "pepe";
      String password = "pepe01";
      String nombreusuario = null;
      JProgressBar jProgreso = new JProgressBar();
      //Obtener el valor de un par�metro
      public String getParameter(String key, String def) {
        return isStandalone ? System.getProperty(key, def) :
            (getParameter(key) != null ? getParameter(key) : def);
      //Construir el applet
      public Upload() {
      //Inicializar el applet
      public void init() {
        try {
          jbInit();
        catch (Exception e) {
          e.printStackTrace();
      //Inicializaci�n de componentes
      private void jbInit() throws Exception {
        titledBorder1 = new TitledBorder("");
        titledBorder2 = new TitledBorder("");
        this.setLayout(null);
        jPanel1.setBackground(Color.lightGray);
        jPanel1.setBorder(BorderFactory.createEtchedBorder());
        jPanel1.setBounds(new Rectangle(113, 70, 541, 151));
        jPanel1.setLayout(null);
        jLabel1.setFont(new java.awt.Font("Dialog", 1, 16));
        jLabel1.setText("Subiendo archivos al servidor");
        jLabel1.setBounds(new Rectangle(150, 26, 242, 15));
        jlmensaje.setFont(new java.awt.Font("Dialog", 0, 10));
        jlmensaje.setForeground(Color.red);
        jlmensaje.setHorizontalAlignment(SwingConstants.CENTER);
        jlmensaje.setText(
            "Por favor, no cierre esta ventana hasta que termine de subir todas " +
            "las fotos");
        jlmensaje.setBounds(new Rectangle(59, 49, 422, 30));
        jlarchivo.setBackground(Color.white);
        jlarchivo.setBorder(titledBorder2);
        jlarchivo.setHorizontalAlignment(SwingConstants.CENTER);
        jlarchivo.setBounds(new Rectangle(16, 85, 508, 24));
        jProgreso.setForeground(new Color(49, 226, 197));
        jProgreso.setBounds(new Rectangle(130, 121, 281, 18));
        jPanel1.add(jlmensaje, null);
        jPanel1.add(jlarchivo, null);
        jPanel1.add(jProgreso, null);
        jPanel1.add(jLabel1, null);
        this.add(jPanel1, null);
        nombreusuario = getParameter("usern");
      //Iniciar el applet
      public void start() {
        jlarchivo.setText("Start() method...");
        iniciar();
      public void iniciar() {
        //init images selected array
        fotos_sel[0] = "C:/fotos/05160009.JPG";
        fotos_sel[1] = "C:/fotos/05160010.JPG";
        fotos_sel[2] = "C:/fotos/05160011.JPG";
         // etc...
         num_fotos_sel=3; //number of selected images
        //conectar al ftp (instanciar clase FtpExample)
        FtpExample miftp = new FtpExample();
        miftp.connect();
        //make the directory
         subirpedido(miftp); 
        jProgreso.setMinimum(0);
        jProgreso.setMaximum(num_fotos_sel);
        for (int i = 0; i < num_fotos_sel; i++) {
          jlarchivo.setText(fotos_sel);
    jProgreso.setValue(i);
    subirFichero(miftp, fotos_sel[i]);
    try {
    Thread.sleep(1000);
    catch (InterruptedException ex) {
    //salida(ex.toString());
    jlarchivo.setText("Proceso finalizado correctamente");
    jProgreso.setValue(num_fotos_sel);
    miftp.close();
    //Detener el applet
    public void stop() {
    //Destruir el applet
    public void destroy() {
    //Obtener informaci�n del applet
    public String getAppletInfo() {
    return "Subir ficheros al server";
    //Obtener informaci�n del par�metro
    public String[][] getParameterInfo() {
    return null;
    //sube al ftp (a la carpeta del usuario) el archivo
    //pedido.txt que tiene las lineas del pedido
    public void subirpedido(FtpExample miftp) {
    jlarchivo.setText("Iniciando la conexi�n...");
    //make folder of user
    miftp.directorio("www/usuarios/" + nombreusuario);
    //uploads a file
    public void subirFichero(FtpExample miftp, String nombre) {
    //remote name:
    String nremoto = "";
    int lr = nombre.lastIndexOf("\\");
    if (lr<0){
    lr = nombre.lastIndexOf("/");
    nremoto = nombre.substring(lr + 1);
    String archivoremoto = "www/usuarios/" + nombreusuario + "/" + nremoto;
    //upload file
    miftp.subir(nombre, archivoremoto);
    class FtpExample
    implements FtpObserver {
    FtpBean ftp;
    long num_of_bytes = 0;
    public FtpExample() {
    // Create a new FtpBean object.
    ftp = new FtpBean();
    // Connect to a ftp server.
    public void connect() {
    try {
    ftp.ftpConnect("localhost", "pepe", "pepe01");
    catch (Exception e) {
    System.out.println(e);
    // Close connection
    public void close() {
    try {
    ftp.close();
    catch (Exception e) {
    System.out.println(e);
    // Go to directory pub and list its content.
    public void listDirectory() {
    FtpListResult ftplrs = null;
    try {
    // Go to directory
    ftp.setDirectory("/");
    // Get its directory content.
    ftplrs = ftp.getDirectoryContent();
    catch (Exception e) {
    System.out.println(e);
    // Print out the type and file name of each row.
    while (ftplrs.next()) {
    int type = ftplrs.getType();
    if (type == FtpListResult.DIRECTORY) {
    System.out.print("DIR\t");
    else if (type == FtpListResult.FILE) {
    System.out.print("FILE\t");
    else if (type == FtpListResult.LINK) {
    System.out.print("LINK\t");
    else if (type == FtpListResult.OTHERS) {
    System.out.print("OTHER\t");
    System.out.println(ftplrs.getName());
    // Implemented for FtpObserver interface.
    // To monitor download progress.
    public void byteRead(int bytes) {
    num_of_bytes += bytes;
    System.out.println(num_of_bytes + " of bytes read already.");
    // Needed to implements by FtpObserver interface.
    public void byteWrite(int bytes) {
    //crea un directorio
    public void directorio(String nombre) {
    try {
    ftp.makeDirectory(nombre);
    catch (Exception e) {
    System.out.println(e);
    public void subir(String local, String remoto) {
    try {
    ftp.putBinaryFile(local, remoto);
    catch (Exception e) {
    System.out.println(e);
    // Main
    public static void main(String[] args) {
    FtpExample example = new FtpExample();
    example.connect();
    example.directorio("raul");
    example.listDirectory();
    example.subir("C:/fotos/05160009.JPG", "/raul/foto1.jpg");
    //example.getFile();
    example.close();

  • I need to download ferefox 9.0 but I cannot find it anywhere. Who can help me with this?

    I need to download ferefox 9.0 but I cannot find it anywhere. Who can help me with this?

    Please note that running out of date versions of Firefox is not recommended, as you will open yourself up to known security issues, alongside bugs and other issues. Is there a specific problem you are having with Firefox that I can help you with?
    You can download Firefox 9 at [http://ftp://ftp.mozilla.org/pub/firefox/releases/9.0.1/win32/en-US/ ftp://ftp.mozilla.org/pub/firefox/releases/9.0.1/win32/en-US/]

  • Error Message:"Cannot find or create the font 'WP-MathA'. Some characters may not display or print correctly."  Who can help me solve this problem?

    Some of the pdf files I work with (receive) come up with a comment: “Cannot find or create the font ‘WP-MathA’. Some characters may not display or print correctly.”  Who can help me solve this problem?
    Thank you in advance for  your time.
    Marlen

    Hello Anubha,
    I am having a similar problem on my machine.  I was using Word 2008 and I created a PDF inside Word.
    I am opening the file on the system itself and I am running Windows 8.1.  I am using Version 11 of Reader.
    When the PDF I created (my resume) attempts to open, it says:  cannot find or create the file Times, Bold.  Some characters may not display or print correctly. 
    However, the entire Reader keeps freezing and will not allow me to open or test print the document.  Also, it is not displaying any of the Bold Times New Roman Print.  Can you please help?  Thanks.

  • Since Ios 7 Update of my iPhone 5 I can not log into any WLAN any more - who can help to solve this major problem

    Hi all,
    I updated my iPhone 5 recently to IOS 7 - Since then I do not get any access to my home WLAN / WIFI with the iphone 5.
    At same time the iphone 3S and IPAD 1 of my wife (both IOS 5.x) still work fine in our homes WLAN / WIFI.
    Who can help to get my Iphone 5 with IOS 7 back to work in the home WIFI ?
    Thanks in advance for any possible solution.
    Best regards
    Dirk from Hamburg Germany

    Try this first.
    On the iPhone go to Settings > General > Reset and select Reset Network Settings.
    This will erase all saved wi-fi networks and settings.
    If no change after this, try resetting your modem and wireless router. Disconnect the router from the power source followed by disconnecting the modem from the power source. Wait a few minutes followed by powering your modem back on allowing it to completely reset before powering your wireless router back on allowing it to completely reset with the modem.

  • Actually i don't  know where to post this, but I'm MBA student and have to do a project about the HR functions in a famous company. and I'd like to talk about Apple inc, so how can i get some information about that, and who can help me in this?

    Can anyone help me in this?

    Sara ~ Apple's mission statement is HERE. But the following statement from Apple's now-CEO Tim Cook during a quarterly earnings conference call on 21 January 2009 may give more insight:
    "There is an extraordinary breadth and depth and tenure among the Apple executive team, and these executives lead over 35,000 employees that I would call "all wicked smart". And that's in all areas of the company, from engineering to marketing to operations and sales and all the rest. And the values of our company are extremely well entrenched.
    We believe that we're on the face of the Earth to make great products, and that's not changing. We're constantly focusing on innovating. We believe in the simple, not the complex. We believe that we need to own and control the primary technologies behind the products we make, and participate only in markets where we can make a significant contribution.
    We believe in saying no to thousands of projects so that we can really focus on the few that are truly important and meaningful to us. We believe in deep collaboration and cross-pollination of our groups, which allow us to innovate in a way that others cannot.
    And frankly, we don't settle for anything less than excellence in every group in the company, and we have the self-honesty to admit when we're wrong and the courage to change. And I think, regardless of who is in what job, those values are so embedded in this company that Apple will do extremely well."

  • Who can help me with this form?

    Having some problems with the form ive placed on my site.
    I cant find the problem. Is there someone who can tell me what i have done wrong.
    you can see the form on.
    http://www.salontouche.nl/explorers.htm
    and the error i get is..
    Oops! This page appears broken. DNS Error - Server cannot be found.
    hope to get some advice..
    this is the contactscript..
    <?php error_reporting(0);
        // VALUES FROM THE FORM
        $name        = $_POST['name'];
        $email        = $_POST['email'];
        $message    = $_POST['msg'];
        // ERROR & SECURITY CHECKS
        if ( ( !$email ) ||
             ( strlen($_POST['email']) > 200 ) ||
             ( !preg_match("#^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)* )\.([A-Za-z]{2,})$#", $email) )
            print "Error: Invalid E-Mail Address";
            exit;
        if ( ( !$name ) ||
             ( strlen($name) > 100 ) ||
             ( preg_match("/[:=@\<\>]/", $name) )
            print "Error: Invalid Name";
            exit;
        if ( preg_match("#cc:#i", $message, $matches) )
            print "Error: Found Invalid Header Field";
            exit;
        if ( !$message )
            print "Error: No Message";
            exit;
    if ( strpos($email,"\r") !== false || strpos($email,"\n") !== false ){ 
            print "Error: Invalid E-Mail Address";
            exit;
        if (FALSE) {
            print "Error: You cannot send to an email address on the same domain.";
            exit;
        // CREATE THE EMAIL
        $headers    = "Content-Type: text/plain; charset=iso-8859-1\n";
        $headers    .= "From: $name <$email>\n";
        $recipient    = "[email protected]";
        $subject    = "Reactie van uw Website";
        $message    = wordwrap($message, 1024);
        // SEND THE EMAIL TO YOU
        mail($recipient, $subject, $message, $headers);
        // REDIRECT TO THE THANKS PAGE
        header("Location: http://www.salontouche.nl/thanks.php");
    ?>
    regards

    Having some problems with the form ive placed on my site.
    I cant find the problem. Is there someone who can tell me what i have done wrong.
    you can see the form on.
    http://www.salontouche.nl/explorers.htm
    and the error i get is..
    Oops! This page appears broken. DNS Error - Server cannot be found.
    hope to get some advice..
    this is the contactscript..
    <?php error_reporting(0);
        // VALUES FROM THE FORM
        $name        = $_POST['name'];
        $email        = $_POST['email'];
        $message    = $_POST['msg'];
        // ERROR & SECURITY CHECKS
        if ( ( !$email ) ||
             ( strlen($_POST['email']) > 200 ) ||
             ( !preg_match("#^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)* )\.([A-Za-z]{2,})$#", $email) )
            print "Error: Invalid E-Mail Address";
            exit;
        if ( ( !$name ) ||
             ( strlen($name) > 100 ) ||
             ( preg_match("/[:=@\<\>]/", $name) )
            print "Error: Invalid Name";
            exit;
        if ( preg_match("#cc:#i", $message, $matches) )
            print "Error: Found Invalid Header Field";
            exit;
        if ( !$message )
            print "Error: No Message";
            exit;
    if ( strpos($email,"\r") !== false || strpos($email,"\n") !== false ){ 
            print "Error: Invalid E-Mail Address";
            exit;
        if (FALSE) {
            print "Error: You cannot send to an email address on the same domain.";
            exit;
        // CREATE THE EMAIL
        $headers    = "Content-Type: text/plain; charset=iso-8859-1\n";
        $headers    .= "From: $name <$email>\n";
        $recipient    = "[email protected]";
        $subject    = "Reactie van uw Website";
        $message    = wordwrap($message, 1024);
        // SEND THE EMAIL TO YOU
        mail($recipient, $subject, $message, $headers);
        // REDIRECT TO THE THANKS PAGE
        header("Location: http://www.salontouche.nl/thanks.php");
    ?>
    regards

  • Any one can help me from this code?

    can someone tell me what the code DBUtil.getMarks(msg),DBUtil.setIndex(pn,rsp)
    may do on the code below that i've downloaded this files from [http://sourceforge.net/projects/asimplesmssende/files/|http://sourceforge.net/projects/asimplesmssende/files/] I cant see any DBUtil.java or DBUtil method on the source codes I want to fixed this code coz it has a error because of DBUtil coz i want to create my own codes like this
    import org.soham.sms.*;
    import java.util.*;
    class Q extends SMSUtil
         Q() throws Exception{
              super("Com16");
         public void processSMS(String pn,String msg) throws Exception
              String rsp=DBUtil.getMarks(msg);
              this.sendSMS(pn,rsp);
              DBUtil.setIndex(pn,rsp);
         public int getCurrentMsgIndex() throws Exception{
              return DBUtil.getIndex();
         public static void main(String[] args) throws Exception{
                   SMSUtil util=new Q();
                   //util.sendSMS("9830740684","Shubho Maha Shashthi Baba...Babun");
                   ArrayList al=new ArrayList();
                   util.startReceive(al,1000);
                   Thread.sleep(60000);
                   /*util.stopReceivingSMS();
                   int s=al.size();
                   for(int i=0;i<s;i++){
                        String x=((String[])al.get(i))[0];
                        String m=((String[])al.get(i))[1];
                        System.out.println(x+" *****  "+m);
    }advance thanks ^^

    Download the DBUtil class from that site as well, then, as that is, seemingly, another "self-written" class. You seemingly need to find a better site from which to plagarise your assignments, it seems.

  • Who can help me with this query???

    I have a table looks like:
    Group_id, Individual_id, field1, field2, field3...
    For individuals in this table who shares the same group id, they have exact same, filed1, 2, 3, 4 but different individual_id.
    How can I comebine them so I can creat a table that looks like:
    group_id, (Individual_id1, individual_id2, 3...), field1, field2, field3....
    Please Help!

    Use the WM_CONCAT function.
    http://www.psoug.org/reference/undocumented.html#uwmc

  • Using Iphoto 11 how do I change filename on photo so when it exports it does so in same sequence as Album created in.  Finder does not have option to keep as is... Thanks to anyone who can help me with this !

    The photos must be viewed in sequence as prepared with the filenames I have chosen to describe them.
    How can I just simply transfer this over to a dvd ?  Any help is appreciated !
    Thank You

    There are two ways to export photos so they remain in the same order as you put them in the iPhoto album:
    A:
    1 -  select the photos in the album and use the Photos ➙ Batch Rename  ➙ Title to Text menu with the option to add a sequential number to the file name.
    2 - Export out of iPhoto via File ➙ Export ➙ File Export with the option File Name = Title.
    B:
    1 - select all of the photos in the album and export via File ➙ Export ➙ File Export with the option File Name = Album name with number. 
    Both method will produce file with the following file name format:  xxxx-01.jpg, xxxx-02.jpg, etc., which will be in the order you had in iPhoto when view alphanumerically in the Finder.
    OT

  • Is there any one who can help me solve this?

    Hi.
    I'm taking AP Computer Scinece AB in high school now.
    I've been assigned many programs so far. But.. I can't figure them out.
    There are two programs I need your help. So..Please!!!!!! Help Me!!!!
    Please!! Enjoy helping me!
    <Program #1>
    It's divided into three small programs and I've figured out one of them, which was the easiest one..You will be able to see the programs if you click on the link below.
    (page1)
    http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=2&page=1
    (page2)
    http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=3&page=1
    <Program #2>
    http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=4&page=1
    The way I figured out first part of program #1 was like this :
    public class ThreeX1
    public static void main ( string[] org )
    system.out.println ();
    int startValue = 21;
    int count = 0;
    while (startValue >1)
    count ++;
    if (startValue % 2 == 0)
    startValue = startValue/2;
    else
    startValue = 3*startValue +1;
    system.out.println ( count );
    ===================================================
    From there, for the second and third programs of program #1, I tried to figure it out by using 'for' statement instead of 'while', but I couldn't.
    So..Please help me out.. Thank you
    or you can e-mail me too. It would be great too.
    add. : [email protected]

    I probably shouldn't be doing your homework but here it is:
    public class ThreeX2{
         public static void main ( String[] org ){
              int startValue = 2;
              while(startValue<100){
                   System.out.print(startValue);
                   System.out.print("\t");
                   System.out.println(timesToGetToOne(startValue));
                   startValue++;
         private static int timesToGetToOne(int intForValue){
              int count = 0;
              while (intForValue!=1){
                   count ++;
                   if (intForValue % 2 == 0)
                        intForValue = intForValue/2;
                   else
                        intForValue = 3*intForValue +1;
              return count;
    public class ThreeX3{
         public static void main ( String[] input ){
              int maximumTries = 1000000;
              int numberOfitterations = 10;
              try{
                   numberOfitterations = new Integer(input[0]).intValue();
              }catch(Exception e){
              try{
                   maximumTries = new Integer(input[1]).intValue();
              }catch(Exception e){
              int startValue = 2;
              while(startValue<maximumTries){
                   if(timesToGetToOne(startValue)==numberOfitterations){
                        System.out.print("When startvalue is: ");
                        System.out.print(startValue);
                        System.out.print(" it will take exatly ");
                        System.out.print(timesToGetToOne(startValue));
                        System.out.println(" iterations to get to 1.");
                        // remove the next line and it will show all values that
                        // takes numberOfitterations amount of times to get to 1
                        break;
                   startValue++;
         private static int timesToGetToOne(int intForValue){
              int count = 0;
              while (intForValue!=1){
                   count ++;
                   if (intForValue % 2 == 0)
                        intForValue = intForValue/2;
                   else
                        intForValue = 3*intForValue +1;
              return count;
    }Problem 3 is diffucult, since the input is one date I assume that the current reading is for this date. I don't
    know the date of the previous reading so I cannot calculate if the consumption is between June through
    Ocober.
    your Main method shoud have 4 inputs date accountNumber currentReading previousReading
    Your main function would look like this:
         public static void main ( String[] input ){
              Calendar date=null;
              int accountNumber = 0;
              int currentReading = 0;
              try{
                   String[] s = input[0].split("/");
                   date = Calendar.getInstance();
                   date.set(Calendar.YEAR,new Integer(s[2]).intValue());
                   date.set(Calendar.MONTH,new Integer(s[0]).intValue()-1);
                   date.set(Calendar.DAY_OF_MONTH,new Integer(s[1]).intValue());
              }catch(Exception e){
                   System.out.println("cannot get date, please start this program the following way: ");
                   System.out.println("programName date(format mm/dd/yyyy) accountNumber currentReading previousReading");
              try{
                   accountNumber = new Integer(input[1]).intValue();
              }catch(Exception e){
                   System.out.println("cannot get account number, please start this program the following way: ");
                   System.out.println("programName date(format mm/dd/yyyy) accountNumber currentReading previousReading");
              try{
                   currentReading = new Integer(input[2]).intValue();
              }catch(Exception e){
                   System.out.println("cannot get current reading, please start this program the following way: ");
                   System.out.println("programName date(format mm/dd/yyyy) accountNumber currentReading previousReading");
              try{
                   previousReading = new Integer(input[3]).intValue();
              }catch(Exception e){
                   System.out.println("cannot get previous reading, please start this program the following way: ");
                   System.out.println("programName date(format mm/dd/yyyy) accountNumber currentReading previousReading");
    // check the date between june and oct:
    // (5>date.get(Calendar.MONTH))&&(9<date.get(Calendar.MONTH))

  • Who can help me,Open this file?

    The file is here
    Can't open-CS6.zip_免费高速下载|百度云 网盘-分享无限制

    You may want to be more clear.
    First of all, why can't you open it yourself? Is the file damaged? Does it give an error? Are you missing plugins?
    Second: it is last saved as a CS5 file:
    0: Created on Windows 5.1 in app version 5.0.0.488 (InDesign Japanese) build 488
    1: Save As on Windows 5.1 in app version 5.0.0.488 (InDesign Japanese) build 488
    2: Open As Copy on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    3: Converted on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    4: Save As on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    5: Recovered MiniSave on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    6: Recovered MiniSave on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    7: Recovered MiniSave on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    8: Recovered MiniSave on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    9: Recovered MiniSave on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    10: Save As on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    11: Save As on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    12: Save As on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    13: Save As on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    14: Most recent Save on Windows 5.1 in app version 7.0.2.522 (InDesign Japanese) build 522
    Finally, if someone *can* open it, then what?

  • Who can help me write a sql?

    Table T has a field F, I want to replace all oldstr with newstr in field F.
    for example: "abc oldstr end" will be updated to "abc newstr end".
    Thanks a lot

    I can't use PrepareStatement in "replace" function like in normal query, update sql command.
    when I do:
    sql: update T set F=replace(F, ?, ?) where F like ?
    pstmt.setString(1, oldstr);
    pstmt.setString(2, newstr);
    pstmt.setString(3, '%'+oldstr+'%');
    DB2 throws:
    DB2Exception: [IBM][CLI Driver][DB2/SUN] SQL0418N A statement contains a use of a parameter marker that is not valid. SQLSTATE=42610
    if I do it like :
    sql: update T set F=replace(F, 'oldstr', 'newstr') where F like ?
    pstmt.setString(1, '%'+oldstr+'%');
    it works well,
    it seems that I can't set parameter inside "replace" function, could anyone tell me how to do? Thanks

  • Who can help to solve this question on MATERIALIZED VIEW and table?thanks

    Hi,dear all.
    If there is a MV with the same name as a table and they both exist in the same schema .
    e.g: MV : test123 and table : test123 (they have same name) exist in schema : schema123.
    when I run a sql : select * from schema123.test123; , what's the result of the execution?? MV or table which of them's data are populated???
    thanks in advance!

    solved.

  • Ive finished my first website now my next problem, who can help?

    Hi there,
    With lots of help from Nadia, ive finished my website..
    http://www.tlmgoldman.com/
    Now ive got to move on to an other level and i hope you can help me.
    As you can see the website is working fine. Now ive got one new question from my client. Is it possible that my client can change the text himself? And he want to add a new page with a lot off new pictures.. for the employers.
    What is the best way to do this. Is it possible to do this without a cms system because cms is for me like flying to mars..
    Is there some kind of program so my client can upload some pictures and changes some text on all the pages?
    I will be happy to hear from you..
    Regards Brian

    Hi thank you for your response,
    but when i replace the text my whole left column dissapears. Must i replace the first text or just add it can you tell me where to put it?
    Welkome bij TLM Goldman<br />
    TLM Goldman levert sinds 2007 consultingdiensten in de branche Trading & Investments. De focus van onze cliënten ligt op de handel in financiële instrumenten en derivaten zoals aandelen, obligaties, energie, carbon, opties, equity swaps, futures en gerelateerde producten. TLM Goldman zet zich in voor zijn cliënten opdat zij concurrerend blijven in hun markt, operationele voordelen behalen en aan internationale wet- en regelgeving voldoen.
    Date: Mon, 24 May 2010 15:54:07 -0600
    From: [email protected]
    To: [email protected]
    Subject: Ive finished my first website now my next problem, who can help?
    Switch to Code View.
    <div id="left_column">
    h3. Welcome to TLM Goldman
    <!begin Cushy CMS editable division>
    <div class="cushycms">
    </div>  <!end cushycms>
    </div>  <!end left_column>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com
    >

Maybe you are looking for