Error in my simple program

hey I'm a beginner to java and i tried to program a simple calculator but my Jcreator says it has an Error this is the program that i encoded:
import javax.swing.JOptionPane;
public class quiz
     public static void main(String[]args)
          String input;
          double quiz1,quiz2,quiz3,quiz4,quiz5,average;
          input=JOptionPane.showInputDialog("Enter first quiz:");
          Double.parseDouble(input);
          input=JOptionPane.showInputDialog("Enter second quiz:");
          Double.parseDouble(input);
          input=JOptionPane.showInputDialog("Enter third quiz:");
          Double.parseDouble(input);
          input=JOptionPane.showInputDialog("Enter fourth quiz:");
          Double.parseDouble(input);
          input=JOptionPane.showInputDialog("Enter fifth quiz:");
          Double.parseDouble(input);
          average=(quiz1+quiz2+quiz3+quiz4+quiz5)/5
          JOptionPane.showMessageDialog(null,"The average is" +average,"Average",JOptionPane.INFORMATION_MESSAGE);
          System.exit(0);
}

shouldn't it be like
input=JOptionPane.showInputDialog("Enter first quiz:");
if (input == null) {
            return;
quiz1 = Double.parseDouble(input); or something like that?
or else your "quiz" variable don't have any value?
Edited by: Billwaa on Dec 14, 2008 8:31 AM

Similar Messages

  • G.drawString giving error in a simple program What is my mistake recti pls

    Iam new to JAVA just trying to print Hii on the applet and it is giving an error saying
    Cannot find symbol
    symbol : method drawString(java.lang.String)
    location: class java.awt.Graphics
    g.drawString("Hi");
    ^
    The prog is
    import javax.swing.*; // even if i change it to import java.applet.Applet it gives error
    import java.awt.*;
    public class trial extends JApplet // if i import the commented iam using extends Applet
    public void paint(Graphics g)
    g.drawString( " Hii " );
    }

    If you are new to Java, stay away from applets and other GUI programs until you know how to program Start here:
    [http://java.sun.com/docs/books/tutorial/getStarted/index.html]

  • Plz tell me the error at this simple program

    at this orogram i want the user to input the number and then he get th factorial...
    my program is:
    import javax.swing.JOptionPane;
    public class Ch4_32a
    public static void main (String[]args)
    int f=1, i=1,N;
    String E;
              String M = JOptionPane.showInputDialog("Enter the number");
              N=Integer.parseInt(M);
              while(i<=N);
                   f=f*i;
                   i++;
              JOptionPane.showMessageDialog(null,"the factorial is"+E);
              f=Integer.parseInt(E);
    ******and when i copile it the result is:
    C:\Documents and Settings\F A M I L Y\Desktop\MyProgs\azza\Ch4_32a.java:22: variable E might not have been initialized
              JOptionPane.showMessageDialog(null,"the factorial is"+E);
    ^
    1 error
    it tell me to init the value of E but ir is a string,,
    so plz help me to get the real error

    i delete the (parseInt{) and compile it completle
    but when i excut it the firs widow appear (Ent the number)
    i Enter the number and then "ok" but the second window don't appear which well tell me the result({f)                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • A way to display error messages from the program

    Dear all,
    I am looking forward to display a set of error messages(in a internal table) during the execution of the program to the user.
    I wanted to know the better way of displaying error messages from my program with more options.
    Well I tried out using displaying errors as ALV list/Grid or as simple list processing.
    But I found some  stanadard transactions (Like in MM and FI  where errors are shown in a better way, but failed to find out how they are done.
    Please guide me.
    Thanks in advance
    Aryan

    Try to use application logging it has a very good way to display a set of messages.
    [http://abap4.tripod.com/Using_Application_Logging.html|http://abap4.tripod.com/Using_Application_Logging.html]
    Run this report in se38 an example sap report to understand logging way to show a set of messages
    Report Name  :  SBAL_DEMO_01
    Edited by: Vighneswaran CE on Dec 19, 2010 3:01 PM
    Edited by: Vighneswaran CE on Dec 19, 2010 3:11 PM

  • Error messages in ABAP program are stored in which table

    hi all,
    Can anyone tell
    error messages in ABAP program are stored in which table??

    Hi Sir ,
    Please have a look below .Hope it is suitable and simpler solution for your question.
    Please do reward if useful.
    Thankx.
    Fuction module for storing error messages  ->'format_message'
    for example...
    data : v_message(100) type c.
    call transaction NNNN mode A update S messages into it_messages.
    loop at it_messages where msgty = 'E'.
    call function 'format_message'
    exporting
    *it_messages details
    importing
    v_message.
    write :/ v_message.
    clear v_message.
    endloop.
    Anothe method - ->
    Here is a sample of the program code for that:
    LOOP AT it_messtab.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    id = it_messtab-msgid
    lang = it_messtab-msgspra
    no = it_messtab-msgnr
    v1 = it_messtab-msgv1
    v2 = it_messtab-msgv2
    IMPORTING
    msg = g_msg
    EXCEPTIONS
    OTHERS = 0.
    IF it_messtab-msgtyp = 'S'.
    it_sucess-sucess_rec = g_msg.
    it_sucess-lifnr = it_header-lifnr." Based on your field
    it_sucess-tabix = v_lines.
    APPEND it_sucess.
    ELSEIF it_messtab-msgtyp = 'E'.
    it_error-error_rec = g_msg.
    it_error-lifnr = it_header-lifnr.
    it_error-tabix = v_lines.
    APPEND it_error.
    ELSE.
    it_info-info_rec = g_msg.
    it_info-lifnr = it_header-lifnr.
    it_info-tabix = v_lines.
    APPEND it_info.
    ENDIF.
    ENDLOOP.

  • JMS: simple program (urgent please)

    I am quite new with the JMS. I am trying to have a simple program running in order to start from it towards the application I want to build.
    I tried to run the sample program below:
    package chat;
    import javax.jms.*;
    import javax.naming.*;
    import java.io.*;
    import java.io.InputStreamReader;
    import java.util.Properties;
    public class Chat implements javax.jms.MessageListener {
    private TopicSession pubSession;
    private TopicSession subSession;
    private TopicPublisher publisher;
    private TopicConnection connection;
    /* Constructor. Establish JMS publisher and subscriber */
    public Chat() throws Exception {
    // Obtain a JNDI connection
    Properties env = new Properties();
    // ... specify the JNDI properties specific to the vendor
    InitialContext jndi = new InitialContext(env);
    // Look up a JMS connection factory
    TopicConnectionFactory conFactory =
    (TopicConnectionFactory) jndi.lookup("TopicConnectionFactory");
    // Create a JMS connection
    TopicConnection connection =
    conFactory.createTopicConnection();
    // Create two JMS session objects
    TopicSession pubSession =
    connection.createTopicSession(false,
    Session.AUTO_ACKNOWLEDGE);
    TopicSession subSession =
    connection.createTopicSession(false,
    Session.AUTO_ACKNOWLEDGE);
    // Look up a JMS topic
    Topic chatTopic = (Topic) jndi.lookup("anytopic");
    // Create a JMS publisher and subscriber
    TopicPublisher publisher =
    pubSession.createPublisher(chatTopic);
    TopicSubscriber subscriber =
    subSession.createSubscriber(chatTopic);
    // Set a JMS message listener
    subscriber.setMessageListener(this);
    // Intialize the Chat application
    set(connection, pubSession, subSession, publisher);
    // Start the JMS connection; allows messages to be delivered
    connection.start();
    /* Initialize the instance variables */
    public void set(TopicConnection con, TopicSession pubSess,
    TopicSession subSess, TopicPublisher pub) {
    this.connection = con;
    this.pubSession = pubSess;
    this.subSession = subSess;
    this.publisher = pub;
    /* Receive message from topic subscriber */
    public void onMessage(Message message) {
    try {
    TextMessage textMessage = (TextMessage) message;
    String text = textMessage.getText();
    System.out.println(text);
    } catch (JMSException jmse) {
    jmse.printStackTrace();
    /* Create and send message using topic publisher */
    protected void writeMessage(String text) throws JMSException {
    TextMessage message = pubSession.createTextMessage();
    publisher.publish(message);
    /* Close the JMS connection */
    public void close() throws JMSException {
    connection.close();
    /* Run the Chat client */
    public static void main(String[] args) {
    try {
    Chat chat = new Chat();
    // Read from command line
    BufferedReader commandLine = new
    java.io.BufferedReader(new
    InputStreamReader(System.in));
    // Loop until the word "exit" is typed
    while (true) {
    String s = commandLine.readLine();
    if (s.equalsIgnoreCase("exit")) {
    chat.close(); // close down connection
    System.exit(0); // exit program
    } else {
    chat.writeMessage(s);
    } catch (Exception e) {
    e.printStackTrace();
    But at the line
    �TopicConnectionFactory conFactory =
    (TopicConnectionFactory) jndi.lookup("TopicConnectionFactory");�
    I got this exception:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at chat.Chat.<init>(Chat.java:24)
         at chat.Chat.main(Chat.java:94)
    I realize that the problem is in the jndi setup. But, the problem is that I do not know where to go now and what should I do. I do not know how can I get the jndi.properties file and where and how to put it.
    Please, kindly advise from your experience. I would appreciate clear steps to have this program running properly. Otherwise, if you do have a sample program that is already running, please provide it to me.

    Thank you for your prompt reply.
    I tried another example.
    package test;
    javax.jms.*;
    import javax.naming.*;
    public class SimpleTopicPublisher { /** * Main method. * * @param args the topic used by the example and, * optionally, the number of messages to send */
    public static void main(String[] args) {
    String topicName = null;
    Context jndiContext = null;
    TopicConnectionFactory topicConnectionFactory = null;
    TopicConnection topicConnection = null;
    TopicSession topicSession = null;
    Topic topic = null;
    TopicPublisher topicPublisher = null;
    TextMessage message = null;
    final int NUM_MSGS;
    // if ((args.length < 1) || (args.length > 2)) {
    // System.out.println("Usage: java " + "SimpleTopicPublisher " + "[]");
    // System.exit(1);
    topicName = new String("MyTopic");
    System.out.println("Topic name is " + topicName);
    if (args.length == 2) {
    NUM_MSGS = (new Integer(args[1])).intValue();
    } else {
    NUM_MSGS = 1;
    /* * Create a JNDI API InitialContext object if none exists * yet. */
    try {
    jndiContext = new InitialContext
    } catch (NamingException e) {
    System.out.println("Could not create JNDI API " + "context: " +
    e.toString());
    e.printStackTrace();
    System.exit(1);
    /* * Look up connection factory and topic. If either does * not exist, exit. */
    try {
    topicConnectionFactory = (TopicConnectionFactory) jndiContext.
    lookup("TopicConnectionFactory");
    topic = (Topic) jndiContext.lookup(topicName);
    } catch (NamingException e) {
    System.out.println("JNDI API lookup failed: " + e.toString());
    e.printStackTrace();
    System.exit(1);
    /* * Create connection. * Create session from connection; false means session is * not transacted. * Create publisher and text message. * Send messages, varying text slightly. * Finally, close connection. */
    try {
    topicConnection = topicConnectionFactory.createTopicConnection();
    topicSession = topicConnection.createTopicSession(false,
    Session.AUTO_ACKNOWLEDGE);
    topicPublisher = topicSession.createPublisher(topic);
    message = topicSession.createTextMessage();
    for (int i = 0; i < NUM_MSGS; i++) {
    message
    .setText("This is message " + (i + 1));
    System.out.println("Publishing message: " + message.getText());
    topicPublisher.publish(message);
    } catch (JMSException e) {
    System.out.println("Exception occurred: " + e.toString());
    } finally {
    if (topicConnection != null) {
    try {
    topicConnection.close();
    } catch (JMSException e) {}
    It is mentioned in SUN JMS tutorial that "When you use the J2EE SDK 1.3.1, your JMS provider is the SDK. " So I am using that and I did the follwoing:
    --start the J2EE server as follows:
    j2ee -verbose
    Then I created the adminstrated object:
    j2eeadmin -addJmsDestination MyTopic topic
    But still getting this error:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    So now where is the error?
    Thank you in advance

  • How to Run a simple program using JMS Queue.!!

    Hi All,
    I am trying to run simple program on JMS Queue.
    Using SOA Suite 10.1.3.2
    I created a connection factory and queue using EM.
    Connection Factory => Domain : Queue JNDI Location : jms/sidConnectionFactory
    Queue Name : SidQueue JNDI Location : jms/SidQueue
    Tried running a simple java class to send the messages to queue.[Pls find the file attached].
    Getting this error
    javax.naming.NamingException: META-INF/application-client.xml not found (see J2EE spec, application-client chapter for requirements and format of the file)
    at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getRequiredClasspathResource(ApplicationClientInitialContextFactory.java:239)
    at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getArchive(ApplicationClientInitialContextFactory.java:161)
    at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:111)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    Can some one tell me how i need to create this file and where to place this[i.e is this need to be placed in  my project or some directory structure of <SOA-HOME>
    Thx,
    Siddhardha.
    Code:
    package demo;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class JMSQueue {
        public static void main(String args[])
    QueueConnection queueConnection;
    QueueSession queueSession;
    //private MessageProducer producer;
    QueueSender queueSender;
    try {          
    String message = "Test";
    String connectionFactoryName = "jms/sidConnectionFactory";
    String destinationName = "jms/SidQueue";
    /*Do i need to use this .......
    * If so where is the error in below statements...
    * Properties env = new Properties( );
    // ... specify the JNDI properties specific to the vendor
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL,
    "ormi://localhost:23791");
    Context ctx = new InitialContext();
    // Get the connection factory.
    QueueConnectionFactory cf = (QueueConnectionFactory)ctx.lookup(connectionFactoryName);
    // Get the destination.
    Queue destination = (Queue) ctx.lookup(destinationName);
    // Use the connection factory to create a connection.
    queueConnection = cf.createQueueConnection();
    // Start the connection.
    queueConnection.start();
    // Use the connection to create a session.
    queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    // Use the session and destination to create a message producer and a message consumer.
    //producer = queueSession.createProducer(destination);
    queueSender = queueSession.createSender(destination);
    TextMessage msg = queueSession.createTextMessage(message);
    queueSender.send(msg);
    queueSession.close();
    queueConnection.close();
    catch (Exception ex) {
    ex.printStackTrace();
    * Attached following libraries to the Project
    * jms.jar
    * optic.jar
    * oc4jclient.jar
    */

    Hi,
    You need to change the INITIAL_CONTEXT_FACTORY to com.evermind.server.RMIInitialContextFactory.
    Regards,
    Sandeep

  • Even a simple program is not working ?

    Hi there,
    I typed a simple program to display the customer details. The program goes like this :
    import java.lang.*;
    public class Customer
         String custname;
         String custID;
    public Customer()
         custname = "Bob";
         custID = "S20010";
    public void displaydetails()
         System.out.println("Customer name is " + custname);
         System.out.println("Customer ID is " + custID);
    public static void main(String a[])
         Customer cust = new Customer();
         cust.displaydetails();
    The compilation went right. But, when I executed the program the following error message is displayed :
    c:\>java Customer.java
    Exception in thread "main" java.lang.NoClassDefFoundError: Customer/java.
    Please help !!

    Don't cross-post.
    http://forum.java.sun.com/thread.jspa?threadID=576890&messageID=2891064#2891064

  • ITunes installation error: does not have program associated with it for performing this action

    Repeated tries to install iTunes continues to fail. Installing on Acer laptop using Windows 7.
    Error: does not have program associated with it for performing this action
    We have done the following: open Default programs, clicked associate a file type, clicked on change program button and selected a program to open with and clicked OK/enter.
    The installation continues. we get to the finish window; click finish.
    Next error: iTunes has been installed incorrectly.
    So, what do we do to get iTunes working?
    Thank you.

    Hi normeagle,
    Welcome to Apple Support Communities.
    You may find this article helpful for troubleshooting your iTunes installation:
    Trouble installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Best,
    Jeremy

  • All of a sudden I'm getting a 'itunes.exe - system error  It says the program can't start because MSVCR80.dll is missing from your computer.  Try reinstalling the program to fix this problem.  I have tried to reinstall and still can't open itunes.  help!

    all of a sudden I'm getting a 'itunes.exe - system error  It says the program can't start because MSVCR80.dll is missing from your computer.  Try reinstalling the program to fix this problem.  I have tried to reinstall and still can't open itunes.  help!

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • Ideas For a Simple Program?

    I need some ideas for a simple program for a project in class. Can anyone help me?

    Import Classes
    import java.io.*;
    public class tictactoe
    Define Variables
    public static InputStreamReader ISR = new InputStreamReader(System.in);
    public static BufferedReader BFR = new BufferedReader(ISR);
    public static String BOX[][] = new String[3][3]; //Integer Arry for tictactoe box
    public static String PName; //Moving Player's Name
    public static String P1Name; //Player 1 Name
    public static String P2Name; //Player 2 Name
    public static String InputPLY; //X or O
    public static String InputStr; //Player's Input
    public static boolean BreakLoop; //Set this to true in PlayGame() to exit
    public static void main(String args[]) throws IOException
    InputPLY = "O";
    BreakLoop = false;
    ClearBOXCache();
    PrintCredits();
    System.out.println("");
    System.out.println("PLEASE ENTER PLAYER 1 NAME");
    P1Name = BFR.readLine();
    System.out.println("PLEASE ENTER PLAYER 2 NAME");
    P2Name = BFR.readLine();
    System.out.println("");
    System.out.print("\nWelcome ");
    System.out.print(P1Name);
    System.out.print(" and ");
    System.out.println(P2Name);
    System.out.println("");
    System.out.println(P1Name + " = X");
    System.out.println(P2Name + " = O");
    PlayGame();
    PrintCredits();
    BFR.readLine();
    System.exit(0);
    public static void DrawGrid()
    This function is to draw the tictactoe grid.
    System.out.println("");
    System.out.println("\t/-----------------------------\\");
    System.out.println("\t|-------- TIC TAC TOE --------|");
    System.out.println("\t|-----------------------------|");
    System.out.println("\t| | | |");
    System.out.println("\t| " + BOX[0][0] + " | " + BOX[0][1] + " | " + BOX[0][2] + " |");
    System.out.println("\t| | | |");
    System.out.println("\t|-----------------------------|");
    System.out.println("\t| | | |");
    System.out.println("\t| " + BOX[1][0] + " | " + BOX[1][1] + " | " + BOX[1][2] + " |");
    System.out.println("\t| | | |");
    System.out.println("\t|-----------------------------|");
    System.out.println("\t| | | |");
    System.out.println("\t| " + BOX[2][0] + " | " + BOX[2][1] + " | " + BOX[2][2] + " |");
    System.out.println("\t| | | |");
    System.out.println("\t\\-----------------------------/");
    public static void PrintCredits()
    This function is to print credits. Intended for startup and ending
    System.out.println("");
    System.out.println("");
    System.out.println("\t-------------------------------");
    System.out.println("\t--------- TIC TAC TOE ---------");
    System.out.println("\t-------------------------------");
    System.out.println("");
    System.out.println("\t-------------------------------");
    System.out.println("\t---- MADE BY WILLIAM CHAN! ----");
    System.out.println("\t-------------------------------");
    public static void ClearBOXCache()
    This function is to clear the BOX's cache.
    It is intended for restarting a game     
    BOX[0][0] = " ";
    BOX[0][1] = " ";
    BOX[0][2] = " ";
    BOX[1][0] = " ";
    BOX[1][1] = " ";
    BOX[1][2] = " ";
    BOX[2][0] = " ";
    BOX[2][1] = " ";
    BOX[2][2] = " ";
    public static void CheckWin(String PLYW) throws IOException
    This function is to check if a player wins
    for (int X = 0; X < 3; X++)
    if (BOX[X][0].equals(PLYW) && BOX[X][1].equals(PLYW) && BOX[X][2].equals(PLYW))
    PrintWin(PLYW);
    for (int Y = 0; Y < 3; Y++)
    if (BOX[0][Y].equals(PLYW) && BOX[1][Y].equals(PLYW) && BOX[2][Y].equals(PLYW))
    PrintWin(PLYW);
    if (BOX[0][0].equals(PLYW) && BOX[1][1].equals(PLYW) && BOX[2][2].equals(PLYW))
    PrintWin(PLYW);
    else if (BOX[0][2].equals(PLYW) && BOX[1][1].equals(PLYW) && BOX[2][0].equals(PLYW))
    PrintWin(PLYW);
    else if (!BOX[0][0].equals(" ") && !BOX[0][1].equals(" ") && !BOX[0][2].equals(" ") && !BOX[1][0].equals(" ") && !BOX[1][1].equals(" ") && !BOX[1][2].equals(" ") && !BOX[2][0].equals(" ") && !BOX[2][1].equals(" ") && !BOX[2][2].equals(" "))
    ClearBOXCache();
    System.out.println("Tie Game!");
    BFR.readLine();
    System.out.println("Game has restarted");
    public static void PrintWin(String PrintWinner) throws IOException
    This function is to print which player won
    if (PrintWinner.equals("X"))
    System.out.println(P1Name + " wins!");
    System.out.println(P2Name + " loses!");
    else if (PrintWinner.equals("O"))
    System.out.println(P2Name + " wins!");
    System.out.println(P1Name + " loses!");
    BFR.readLine();
    ClearBOXCache();
    System.out.println("Game has restarted!");
    public static void PrintInstruction(String PLYINSTR)
    This function is to give instruction to the player
    if (PLYINSTR.equals("X"))
    PName = (P1Name);
    else if (PLYINSTR.equals("O"))
    PName = (P2Name);
    System.out.println("");
    System.out.println(PName + ":");
    System.out.println("PLEASE MAKE YOUR MOVE");
    System.out.println("");
    System.out.println("TL = TOP LEFT BOX, TM = TOP MIDDLE BOX, TR = TOP RIGHT BOX");
    System.out.println("ML = MIDDLE LEFT BOX, MM = MIDDLE MIDDLE BOX, MR = MIDDLE RIGHT BOX");
    System.out.println("BL = BOTTOM LEFT BOX, BM = BOTTOM MIDDLE BOX, BR = BOTTOM RIGHT BOX");
    public static void PlayGame() throws IOException
    This function is the main game function.
    It calls other game functions.         
    Define Variables
    while(true)
    if (InputPLY.equals("O"))
    InputPLY = "X";
    else if (InputPLY.equals("X"))
    InputPLY = "O";
    while(true)
    PrintInstruction(InputPLY);
    InputStr = BFR.readLine(); //Player's move
    Check player's move
    if (InputStr.equals("TL"))
    if (BOX[0][0].equals(" "))
    BOX[0][0] = InputPLY;
    break;
    else if (InputStr.equals("TM"))
    if (BOX[0][1].equals(" "))
    BOX[0][1] = InputPLY;
    break;
    else if (InputStr.equals("TR"))
    if (BOX[0][2].equals(" "))
    BOX[0][2] = InputPLY;
    break;
    else if (InputStr.equals("ML"))
    if (BOX[1][0].equals(" "))
    BOX[1][0] = InputPLY;
    break;
    else if (InputStr.equals("MM"))
    if (BOX[1][1].equals(" "))
    BOX[1][1] = InputPLY;
    break;
    else if (InputStr.equals("MR"))
    if (BOX[1][2].equals(" "))
    BOX[1][2] = InputPLY;
    break;
    else if (InputStr.equals("BL"))
    if (BOX[2][0].equals(" "))
    BOX[2][0] = InputPLY;
    break;
    else if (InputStr.equals("BM"))
    if (BOX[2][1].equals(" "))
    BOX[2][1] = InputPLY;
    break;
    else if (InputStr.equals("BR"))
    if (BOX[2][2].equals(" "))
    BOX[2][2] = InputPLY;
    break;
    else if (InputStr.equals("RESTART"))
    ClearBOXCache();
    System.out.println("");
    System.out.println("GAME RESTARTED!");
    System.out.println("");
    break;
    else if (InputStr.equals("QUIT"))
    BreakLoop = true;
    break;
    if (BreakLoop == true)
    break;
    DrawGrid();
    CheckWin(InputPLY);
    }

  • Any ideas for a (fairly) simple program?

    Does anybody have any ideas for a fairly simple program that I could try to write (I am a fair programmer, but I'm not to creative)?

    You know, Java Game Programming for Dummies is actually a pretty good book (despite the "Dummies" part!) It is written in 1.0, but it has a "ponglet", card games, and several maze games. All the applets I've tried from them actually work (some typos in the book itself, but the CD is ok). Any of these could be "starter" code.
    Yahoo has a whole bunch of Java applet games. You could try to reproduce pieces of the games you see. (These are also interesting in the sense that you can immediately see what works in a game and what doesn't.)
    It is always fun to write little components. Cool buttons (write a nice little non-rectangular button that lights up or something), text boxes that look like digital displays, funny text labels (maybe with a weird font or with letters that jump all over the place when you mouse over them).. These don't take a whole lot of time to write, but write them well and they are very useful for your future games.
    Enjoy!
    :) jen

  • Error in executing ABAP program. Error occurred when creating dataset

    hi,
    when I use LKM SAP ERP to Oracle (SQLLDR) to extract data from SAP ERP server. I execute my interface, and it's stop at extract data step.
    This is message:
    java.lang.RuntimeException: Error occured in open tool execute method...Error in executing ABAP program...Error in executing ABAP program...Error occurred when creating dataset/abc/ZODI_13001_6001_GLOBAL.txt
    I tried others path name, tried slash or backslash. This is content in code tab
    OdiSAPAbapExecute "-UPLOAD=1" "-EXECUTE=1" "-EXECUTEBASE_RKM=0" "-ZRFC_RUN_INSTALL=1" "-ABAP_PROGRAM_NAME=ZODI_13001_6001" "-HOST=10.86.87.24" "-USER=sv_hoa" "-PASSWORD=<@=snpRef.getInfo("SRC_PASS") @>" "-SAP_CLIENT=800" "-SAP_LANGUAGE=EN" "-SAP_SYSTEM_NUMBER=02" "-SAP_FUNCTION_GROUP_NAME=ZODI_FGR_13001" "-CONNECTION_POOL_NAME=SAP_ODI_ERP_POOL_10.86.87.24" "-CONNECTION_POOL_SIZE=10" "-FILE_DELIMITER=<@=""+(char)8@>" "-FILE_NAME=ZODI_13001_6001_GLOBAL.txt" "-FTP_HOST=10.86.82.108" "-FTP_USER=anh" "-FTP_PASSWORD=<@=sFtpPassword@>" "-FTP_PASSIVE_MODE=1" "-FTP_TRANSFER_TIMEOUT=100000" "-ODI_VARIABLE_NAMES=" "-ODI_VARIABLE_VALUES=" "-USER_ABAP_PARAMETER_NAMES=IV_DELIMITER,CHAR3;IV_FILENAME,CHAR255;IV_USER,CHAR35;IV_PWD,CHAR35;IV_HOST,CHAR35;IV_HASHVALUE,CHAR35;IV_PATH,CHAR35;IV_MAX_ROW_CNT,SYTABIX;IV_FETCH_BATCH_SIZE,SYTABIX;" "-USER_ABAP_PARAMETER_VALUES=<Value>" "-USER_ABAP_PARAMETER_SEPARATOR=<Value>" "-ABAP_TABLE_PARAMETERS=RETURN,BAPIRETURN;ET_FILE_RETURN,BAPIRET2" "-ABAP_EXPORT_PARAMETERS=ERRORMESSAGE;SY-MSGV1" "-LOG_FILE_NAME=C:\Users\anh\AppData\Local\Temp\SapAbapExecuteOpenTool_13001.log" "-FTP_PATH=/abc/" "-DEV_CLASS=ZODI_DEVCLASS" "-MAX_ROW_COUNT=" "-FETCH_BATCH_SIZE=100000" "-HASH_VALUE_MARKER=HVM" "-ABAP_PROGRAM_BODY=
    *Final Type declarations
    TYPES : BEGIN OF ty_final,
    Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_final.
    *Final Temp Type Declarations
    TYPES : BEGIN OF ty_final_tmp,
    Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID ,
    Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH ,
    Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH ,
    Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH ,
    Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI ,
    Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU ,
    END OF ty_final_tmp.
    *Final Target Type Declarations
    TYPES : BEGIN OF ty_final_target,
    C0_Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_final_target.
    * Table type for Y03HOCSINH
    TYPES : BEGIN OF ty_Y03HOCSINH,
    HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_Y03HOCSINH.
    TYPES: BEGIN OF gs_text,
    line(843) TYPE c,
    END OF gs_text.
    *Structure Declarations
    DATA: wa_final_string TYPE string,
    wa_final TYPE ty_final,
    wa_final_target TYPE ty_final_target,
    wa_Y03HOCSINH TYPE ty_Y03HOCSINH,
    *Table Declarations
    tt_final TYPE STANDARD TABLE OF ty_final,
    tt_Y03HOCSINH TYPE STANDARD TABLE OF ty_Y03HOCSINH,
    tt_final_target TYPE STANDARD TABLE
    OF ty_final_target,
    tt_final_tmp TYPE STANDARD TABLE OF ty_final_tmp,
    tt_final_tmp1 TYPE STANDARD TABLE OF ty_final,
    gt_result TYPE STANDARD TABLE OF gs_text,
    *Variable Declarations
    lv_path TYPE string,
    lv_flag TYPE char1,
    C0_Y03HOCSINH_HOCSINH_ID TYPE
    STRING,
    C1_Y03HOCSINH_MA_HOC_SINH TYPE
    STRING,
    C2_Y03HOCSINH_TEN_HOC_SINH TYPE
    STRING,
    C3_Y03HOCSINH_GIOI_TINH TYPE
    STRING,
    C4_Y03HOCSINH_DIA_CHI TYPE
    STRING,
    C5_Y03HOCSINH_GHI_CHU TYPE
    STRING,
    wa_final_tmp TYPE ty_final_tmp,
    lv_file TYPE string,
    lv_datum TYPE sy-datum,
    lv_date TYPE char10,
    wa_result TYPE string,
    lv_delimiter type string,
    lv_cnt TYPE sytabix,
    *-Cursor Declaration
    lv_Y03HOCSINH_dbcur TYPE cursor,
    lv_tabix_frm TYPE sy-tabix.
    lv_delimiter = iv_delimiter.
    IF iv_hashvalue = 'HVM'.
    *Open/delete output file
    CONCATENATE iv_path iv_filename INTO lv_path.
    *Check for file existence, if found, delete it
    OPEN DATASET lv_path FOR INPUT
    IN TEXT MODE
    ENCODING DEFAULT.
    IF sy-subrc EQ 0.
    DELETE DATASET lv_path.
    ENDIF.
    *Open/create output file
    OPEN DATASET lv_path FOR APPENDING
    IN TEXT MODE
    ENCODING DEFAULT.
    IF sy-subrc EQ 0.
    *Batch Processing
    OPEN CURSOR WITH HOLD lv_Y03HOCSINH_dbcur FOR
    SELECT HOCSINH_ID
    MA_HOC_SINH
    TEN_HOC_SINH
    GIOI_TINH
    DIA_CHI
    GHI_CHU
    FROM Y03HOCSINH.
    DO.
    *Check for the counter, only for first batch
    *process new line is required...
    lv_cnt = lv_cnt + 1.
    REFRESH tt_Y03HOCSINH.
    FETCH NEXT CURSOR lv_Y03HOCSINH_dbcur
    APPENDING TABLE tt_Y03HOCSINH
    PACKAGE SIZE IV_FETCH_BATCH_SIZE.
    IF NOT tt_Y03HOCSINH IS INITIAL.
    ELSE.
    EXIT.
    ENDIF.
    LOOP AT tt_Y03HOCSINH INTO wa_Y03HOCSINH.
    MOVE wa_Y03HOCSINH-HOCSINH_ID
    TO wa_final_tmp-Y03HOCSINH_HOCSINH_ID.
    MOVE wa_Y03HOCSINH-MA_HOC_SINH
    TO wa_final_tmp-Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_Y03HOCSINH-TEN_HOC_SINH
    TO wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_Y03HOCSINH-GIOI_TINH
    TO wa_final_tmp-Y03HOCSINH_GIOI_TINH.
    MOVE wa_Y03HOCSINH-DIA_CHI
    TO wa_final_tmp-Y03HOCSINH_DIA_CHI.
    MOVE wa_Y03HOCSINH-GHI_CHU
    TO wa_final_tmp-Y03HOCSINH_GHI_CHU.
    APPEND wa_final_tmp TO tt_final_tmp.
    ENDLOOP.
    free : tt_Y03HOCSINH.
    LOOP AT tt_final_tmp INTO wa_final_tmp.
    MOVE wa_final_tmp-Y03HOCSINH_HOCSINH_ID
    TO wa_final_target-C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_tmp-Y03HOCSINH_MA_HOC_SINH
    TO wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH
    TO wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_tmp-Y03HOCSINH_GIOI_TINH
    TO wa_final_target-C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_tmp-Y03HOCSINH_DIA_CHI
    TO wa_final_target-C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_tmp-Y03HOCSINH_GHI_CHU
    TO wa_final_target-C5_Y03HOCSINH_GHI_CHU.
    Append wa_final_target to tt_final_target.
    ENDLOOP.
    free : tt_final_tmp.
    Clear wa_final_target.
    IF NOT iv_max_row_cnt IS INITIAL.
    Loop at tt_final_target into
    wa_final_target TO iv_max_row_cnt.
    MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
    TO C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
    TO C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
    TO C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
    TO C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
    TO C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
    TO C5_Y03HOCSINH_GHI_CHU.
    CONCATENATE
    C0_Y03HOCSINH_HOCSINH_ID
    C1_Y03HOCSINH_MA_HOC_SINH
    C2_Y03HOCSINH_TEN_HOC_SINH
    C3_Y03HOCSINH_GIOI_TINH
    C4_Y03HOCSINH_DIA_CHI
    C5_Y03HOCSINH_GHI_CHU
    INTO wa_final_string
    SEPARATED BY lv_delimiter.
    IF sy-tabix EQ 1 AND lv_cnt EQ 1.
    CONCATENATE wa_final_string
    lv_delimiter INTO wa_final_string.
    ELSE.
    CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
    lv_delimiter INTO wa_final_string.
    ENDIF.
    APPEND wa_final_string TO gt_result.
    CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU.
    ENDLOOP.
    ELSE.
    Loop at tt_final_target into wa_final_target.
    MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
    TO C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
    TO C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
    TO C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
    TO C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
    TO C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
    TO C5_Y03HOCSINH_GHI_CHU.
    CONCATENATE
    C0_Y03HOCSINH_HOCSINH_ID
    C1_Y03HOCSINH_MA_HOC_SINH
    C2_Y03HOCSINH_TEN_HOC_SINH
    C3_Y03HOCSINH_GIOI_TINH
    C4_Y03HOCSINH_DIA_CHI
    C5_Y03HOCSINH_GHI_CHU
    INTO wa_final_string
    SEPARATED BY lv_delimiter.
    IF sy-tabix EQ 1 AND lv_cnt EQ 1.
    CONCATENATE wa_final_string
    lv_delimiter INTO wa_final_string.
    ELSE.
    CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
    lv_delimiter INTO wa_final_string.
    ENDIF.
    APPEND wa_final_string TO gt_result.
    CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU.
    ENDLOOP.
    ENDIF.
    free : tt_final_target.
    IF NOT gt_result IS INITIAL.
    CLEAR wa_result.
    LOOP AT gt_result INTO wa_result.
    TRANSFER wa_result TO lv_path.
    ENDLOOP.
    ENDIF.
    REFRESH gt_result.
    *End of main loop for batching
    ENDDO.
    *Close dataset
    CLOSE DATASET lv_path.
    CLOSE CURSOR lv_Y03HOCSINH_dbcur.
    ELSE.
    DATA: lv_mesg TYPE string.
    CLEAR et_file_return.
    et_file_return-type = 'E'.
    CONCATENATE
    'Error occurred when creating dataset' lv_path
    INTO lv_mesg.
    et_file_return-message = lv_mesg.
    Append et_file_return.
    ENDIF.
    ELSE.
    CLEAR et_file_return.
    et_file_return-type = 'E'.
    et_file_return-message =
    'Installed ABAP program does not match interface definition'.
    APPEND et_file_return.
    ENDIF.
    Thanks for help

    r u able to figure it out..........i got the same error .......can someone help me fix this issue

  • Parsing error in file C:\Program Files (x86)\HP\D​igital Imaging\bi​n\hpqscloc​\1033-xml

    Spoiler (Highlight to read)
    I have a HP Photosmart Premium C310a All-In-One I can not open solution center get the message I wrote as a subjekt.I´ve tried a lot of methods I´m 75 years old and I´m tired of this problem!    I´ve got 2 computers one HPdv5009 with W.XP Home Edition and it works free from problem The solution center opens up without any problem but on the other HP dv7 with W.7 Home Premium 64 Solution center did not like my order to open up! Parsing error in file etc. That is the answer I got!
     Please Help Me anybody!
    This question was solved.
    View Solution.

    Hello-
    I have included a link where the issue has been resolved. Look for the file that is in grreen_apple's post. (attachment)
    http://h30434.www3.hp.com/t5/Scanning-Faxing-and-C​opying/Parsing-error-in-file-c-Program-Files-HP-Di​...
    Also, remember a click on the Kudos star to the left is a quick "Thanks" for a helpful post.
    Please select the "Accept as Solution" button on the post that best answers your question.
    I appreciate your input !
    Thank You,
    Donald

  • Parsing error in file C:\Program Files (x86)\HP\Digital Imaging\bin\hpqscloc\1033.xml

    The HP Solution Centre has disappeared from my toolbar and we I attempt to open it with the program file I receive the above error

    Hi ... I have the same kind of error message:
    Parsing error in file C:\Program Files (x86)\HP\Digital Imaging\bin\hpqscloc\1033.xml
    Have been searching for a solution, using different sort of key words, no luck so far.
    Anyone here? Many thanks in advance.

Maybe you are looking for

  • Itunessetup.exe is not a valid win32 application?

    I am trying to install the newest version of iTunes, but no matter what I try, the same error message comes up and won't let me install -- itunessetup.exe is not a valid win32 application. What do I do? Thanks.

  • Missing Namespace with the SOAP msg sent by C#

    Hi All, The wsdl file is generated by SAP XI. I used the XMLSpy to test it and get successful response. Then I used wsdl.exe of .net 2.0 sdk to generate the C# proxy class, and use csc.exe to compile it to a dll, and then refer it in the project. Aft

  • HT1338 What software is needed in Mountain Lion to open DVDs?

    I have an application 'DVD Player" but any DVDs put into my Mac book pro are thrown out and nothing appears on the desktop. Does mountain lion need some other application?

  • Upgrading From 1.4 to 1.6

    Hey Guys, Just upgraded from v1.4 to v1.6. I'm having one issue with an XML file I have. I've got the folloing XML: <productName>Product X</productName> <productDesc> <![CDATA[ <p>text here</p> ]]> </productDesc> Since upgrading to 1.6, the data with

  • How to safely remove a redudant heart beat

    Envirnoment: Solaris 2.6 SC 2.2 2 node cluster dual heart beat network I need to remove a network card to free up a PCI slot in each node. All of the slot is filled in both nodes. The single ethernet card is currently one of the two heart beat. Can I