Ideas for new Java Program

I'm looking for some ideas of simple java programs that I can use for a final project at school. Anyone got ideas?
Thanks, G

TuringPest wrote:
Encephalopathic wrote:
yawmark wrote:
[Ideas for student projects|http://www.mindprod.com/projects/projects.html].
Typo. Correct site: [http://www.mindprod.com/project/projects.html|http://www.mindprod.com/project/projects.html]
"sanity checker" was not as cool as it sounded.
i imagined some sort of luscher color test + response time checker psychological monitoring system.that wouldn't be nice for the kids as it would give them unexpected (to them) output when they ran it on themselves...

Similar Messages

  • 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);
    }

  • How can i create a test suite in oracle for a java program

    hi
    i have to create a table for test cases for a java program
    in that my main concentration is on branch statements
    i have problems to choose which fields should be there in my table
    plz let me know if you have nay ideas
    thnx
    regards
    [email protected]

    no idea based on the little or nothing you've posted.
    %

  • Ideas for a Java based Thesis

    Hi,
    does anybody have any good ideas for a Java based Thesis project, something that could be completed in no more than 6 months. I have been working with Servlets & J2ME for over a year, but I'm having trouble coming up with a good/challenging project....
    Any help appreciated,
    Shane

    You can find a ton of potential student projects here:
    http://mindprod.com/projects.html
    Dunno if any of them fit your criteria - but it's a start...
    Good luck!
    Grant

  • Process name representation in a LINUX machine for a JAVA program running..

    Hi,
    We are using an Intel machine loaded with Red Hat Linux 7.2 OS to run JAVA programs. We have a requirement to calculate the CPU and MEMORY usage for each JAVA program running. Unfortunately when a java program is run say "java ESR" and we run a ps -ef | grep -i java, it is shown as hkumar 2847 2799 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2874 2847 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2875 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2876 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2877 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2878 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2879 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2880 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2881 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2882 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2883 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2884 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2885 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    instead of the actual name of the program ie. ESR.
    Does anybody know why this happens? Is there a way out to ensure that "ps -ef | grep java" gives the actual name of the java program being RUN?
    Thanks in advance,
    Harish

    You have less chance to identify which programm that VM instance is running right now.
    But you could (as we do) keep track of your programs if you save the process-id when you start the program.
    We need this to shut down running java batch programs but you could find out the used system resources with this way as well...

  • Need ideas for new PJC/Java Beans

    Hello everybody,
    I am always looking for new ideas about the Java Bean and PJC stuff. Sometimes I have good ideas about this, but sometimes it is quite a pain to find something new and innovative.
    If you have ideas or needs about this, let me know in this thread.
    (Sorry Oracle staff if I am going beyond my rights by using the Forum for that purpose)
    Francois

    Francois ,
    I think that we all need to thank you for all your hard work promoting Oracle Forms.
    Your input and constant support on this forum is greatly appreciated.
    But I personally think that all this needs to be addressed by Oracle.
    Your wrote
    Sometimes I have good ideas about this, but sometimes it is quite a pain to find something new and innovative.
    And I agree with you.
    You can go as far as the Forms let you go...
    Thanks,
    Michael

  • Which is the best and user freindly IDE for developing Java GUI application

    Please advice me if there is any good IDE for developing all kind of Java applications.
    I m confused about which IDE to use.
    I have Searched on Net also. and most of the answers i found was for JBuilder and JBoss.
    But cant confirm until u guys suggest me.
    Because i think this is the best place to ask questions about java.
    Please advice

    If you're developing JSPs and Servlets....
    I've found that using Eclipse (which is free) coupled with the MyEclipse plug-in (an advanced J2EE specific plug-in which costs $29.99USD/year) was the best for me. I've tried several free J2EE Eclipse plug-ins, didn't like them. Wasn't a big fan of NetBeans either, but I liked it tons better than the other Eclipse plug-ins.
    Therefore, IMHO for free I'd go with NetBeans, for a small fee I'd go with Eclipse/MyEclipse plug-in.
    If you are new to J2EE but not to Java, you may want to consider going straight to JSF and Sun's Java Studio Creator. This is not free, but the fee is one-time and development is (mostly) visual using Java Studio Creator.

  • New Java Programming Student Needs Help

    Hey everyone,
    I've just started taking a Java programming class at Penn State University, and I have had some prior experience with programming, i.e. C, C++, HTML, SQL. However, this will be my first attempt at Java. I know there are a lot of similarities between C++ and Java, but I'm still a little lost on some methodology.
    To get myself going, I've been looking through the textbook a little and came across a problem that gave me some difficulty. I'll write out the outline:
    A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and time and a half (i.e. 1.5 times their hourly wage) for overtime hours worked, commission workers (who receive $250 plus 5.7% of their gross weekly sales), and pieceworkers (who receive a fixed amount of money per item for each of the items they produce � each pieceworker in this company works on only one type of item).
    +Define a Java class named EmployeePayment that includes functionality to compute the weekly pay for each employee. You do not know the number of employees in advance. Each type of employee has its own pay code: Managers have paycode 1, hourly workers have paycode 2, commission workers have paycode 3 and pieceworkers have paycode 4.+
    +Define a main method that creates an instance of the EmployeePayment class, and calls the setManagerPay method to set the managers weekly salary to $625.00. The main method should then prompt the user for the paycode ��Enter paycode (-1 to end): �, validate the input and perform the associated processing for that paycode. Your program should allow the user to process employees until a paycode of -1 has been entered. Use a switch structure to compute each employee�s pay, based on the employee�s paycode. Within the switch, prompt the user (i.e. the payroll clerk) to enter the appropriate facts your program needs to calculate each employee�s pay based on that employee�s paycode, invoke the respective method (defined below) to perform the calculations and return the weekly pay for each type of employee, and print the returned weekly pay for each employee.+
    +Define a setManagerPay method that accepts and stores the fixed weekly salary value for managers.+
    +A private instance variable weeklyManagerPay should be defined in the EmployeePayment class to support these accessor and mutator methods.+
    +Define a calcManagerPay method that has no parameters and returns the fixed weekly salary.+
    +Define a calcHourlyWorkerPay method that accepts the hourly salary and total hours worked as input parameters and returns the weekly pay based on the hourly worker pay code description.+
    +Define a calcCommWorkerPay method that accepts the gross weekly sales as an input parameter and returns the weekly pay based on the commission worker pay code description.+
    +Define a calcPieceWorkerPay method that accepts the number of pieces and wage per piece as input parameters and returns the weekly pay based on the piece worker pay code description.+
    +Once all workers have been processed, the total number of each type of employee processed should be printed. Define and manage the following private instance variables (*numManager*, numHourlyWorker, numCommWorker, and numPieceWorker) within the EmployeePayment class. What are the ways in which these variables can be updated?+
    Sorry for the length, but I wanted this to be thorough. Basically, I'm having the most trouble writing the switch statement, and outputting the total number of each type of employee...
    Any help and pointers will be greatly appreciated...thanks all.

    You said you've written C and C++ code before. I don't have an excellent memory but from the little code that I wrote in C, I believe the switch statement is exactly the same.
    Read this: [http://java.sun.com/docs/books/tutorial/java/nutsandbolts/switch.html]
    If you're having trouble understanding something post what your specific problem is. No one is going to write your homework for you, but many, myself included, would be more than willing to help if you're really stumped. Just post your concise problem.
    Edited by: sheky on Mar 12, 2008 9:52 PM

  • Executing new Java Program

    Hey,
    So I'd like to be able to execute another java program.
    File directory = new File(".");
                try {
                    List<String> l = new ArrayList<String>();
                    l.add("Java "+directory.getCanonicalPath+"AnotherProject/bin/main.class");
                    ProcessBuilder pb = new ProcessBuilder(l);
                    pb.start();
                } catch (IOException ex) {
                    ex.printStackTrace();
                }What am I doing wrong? I'm getting the error: "No such file or directory."
    Edited by: Moopz on Nov 8, 2010 1:01 AM

    That is entirely up to you! That will be your entry point. If you are able to think of you application as two parts one server, one client part and you have no problems building the separate parts into "working" applications, then their respective main methods would be good enough as start-methods. It's just a name.
    Really, the principle is as easy as this, Suppose you have a HelloWorld class (think Server) and a GoodbyeMoon class (think client) looking like:
    public class GoodbyeMoon {
         public static void main(String[] args) {
              System.out.println("Good bye, Moon!");
    }Then you're application can do this:
    public class LoginMain {
         public static void main(String[] args) {
                    // ... GUI to select MOON or WORLD
                    if (userSelection == MOON ) {
                          GoodbyeMoon.main(null);
                    } else {
                          HelloWorld.main(null);
    }

  • HELP for Compile java programe !

    Hello All,
    i want to make java programe by which i can compile java programes
    and when i compile java programe from my programe then
    i shoul get compiled status means programe compile successfuly
    or not compile.
    if any example i m thanksfull.
    onlyforjava.

    how about if compile fail?
    the process obj seems return value 0 as it run successful.
    I haven't try this, but I have experienced the process obj returns 0 if the executed command has some routine to handle error cases, in which, error will not halt the system.
    So, I recommand the following scenario.
    1. let say, if your java is test.java. check the existence of file test.class.
    If, it exists, get its modified time.
    2. compile the java code with
    Procress p = Runtime.exec(new String[]{"javac", "test.java"});
    3. get the error string if any.
    InputStream in = new BufferedInputStream(p.getInputStream());int read;while ((read = in.read()) != -1){  System.out.println((char)read);}
    4. handle error with the exitValue
    if (p.exitValue() != 0){  System.out.println("warning.");}
    5. check again the file test.class if it is a newly created file.
    6. if it is newly created, compile success. Else, failed.

  • Who do I contact with an idea for new Apple product?

    I have an idea for a new Apple product which I believe could allow them to venture into a new tech maket. However I am unable to find an e-mail address for anyone even moderately related to the Apple design team. Any help with contact details would be much appreciated.

    See this link to submit an unsolicted idea:
    Apple - Legal - Unsolicited Idea Submission Policy

  • Idea for new iphone accessory

    I think I have a very nice idea for a new iphone accessory, one that would probably require the upcoming 3.0 software, since it would require a external piece of hardware.
    I myself have no technical skills. So development would have to be done by a third party.
    Actually the same is true for the financial side. Really all I have is an idea, and I am sure that my idea is new. There isn't anything like it on the market yet.
    What to do??

    Get a patent for it. Once you have the patent, shop it to other iPhone accessory manufacturers.

  • I have ideas for new iphone who do i contact

    i have many ideas for the new apple iphone but i do not know who to contact

    Like any company, Apple will not accept unsolicited ideas.
    Tell your mother.  I find that Mothers are generally very supportive.

  • Installer for a Java Program

    Hello, folks.
    I've written an application that I feel is ready to show to others, and would like to provide it with an installer.
    I need to check that JRE 1.4 is installed, install it if it isn't, install the application to a directory, set install/uninstall options in the control panel, and add a start menu item. (This will be a Windows-platform installer.)
    Could any of you suggest a free (not demo) installer system that I could use? I've heard that there are some good ones out there, but I don't have their names and associated URL's.
    thanks,
    Andrew

    Hello All,
    This is may be bit of a tangent, but hopefully it can be helpful regardless...
         I'm looking into installer programs that are java friendly with the ability to generate a gui-based install program for multiple platforms. I went out and tried to find as many programs that match these specs (list below). Before I dive headlong into demo-sampling-mode - I was hoping folks would share any positive or negative experiences they've had with any of the apps listed below.
    http://www.denova.com/ - DeNova
    http://www.fawcette.com/Archives/premier/mgznarch/javapro/2000/06jun00/rv0006/rv30006.asp - InstallShield Java Edition 3.0
    http://www.alphaworks.ibm.com/tech/beanbag - BeanBag
    http://www.alphaworks.ibm.com/tech/installtoolkit - Install Toolkit for Java
    http://www.jadcentral.com/codecentral/code_profile.jsp?category_ID=4&code_ID=112 - ITW Installer For Java Applications
    http://www.zerog.com/ - InstallAnywhere (some free, some not)
    http://www.gjt.org/info/design/autorad.shtml - AutoRad [GPL]
    http://www.xenonsoft.demon.co.uk/products/freeinstaller/index.html - freeinstaller [Open Source]
    http://www.izforge.com/izpack/ - IzPack [Open Source]
    http://www.toolshed.com/download/installer/install.html - Java Self Installer [GPL]
    http://liftoff.sourceforge.net/ - Lift-Off [GPL]
    http://packlet.sourceforge.net/ - Packlet installer tool [Open Source, LGPL]
    http://vainstall.sourceforge.net/ - VAInstall [GPL]
    Comparisons:
    http://www.zerog.com/products_pu_05.html
    Cheers,
    Enrique
    cc comp.lang.java.softwaretools
    cc forum.java.sun.com > Java Programming > Installer for a Java Program

  • Shell script for executing java program

    i want to write a shell script which will export the classpath and compile & run the java program.
    any references from where i can get that?

    Try typing "man sh" at the command prompt.
    Ultimately it'll end up looking a lot like this:
    #!/bin/sh
    CLASSPATH=/path/to/a.jar:/path/to/anther.jar
    JAVA_HOME=/path/to/where/you/installed/java
    $JAVA_HOME/bin/java your.classes.package.YourClass

Maybe you are looking for

  • Mail is not working

    After I SL mail stopped working. At first I thought it was only mail with attachments but i tried a simple text only email and it will not send, it just stays in outbox... Anyone else having the same issue?

  • User Exit or Badi when opening a Work Order

    I am looking for a user exit or badi that triggers when a work order is opened or better yet when the components tab/button is clicked.

  • Bad color tint added in process of making m2v files

    I exported some footage that I had color corrected very specifically, but after it goes through Compressor in an m2v conversion, it comes with this awful red tint. I can go back to the original movie and try to overcompensate, but I shouldn't have th

  • Unable to remove image from photoshop

    unable to remove image from photoshop

  • FDF import/export not for every PDF available

    Hello, I am using Adobe Reader X 10.1.2 and I have used it to create corrections on PDFs via comment functionality. To avoid big data amounts I want to use the FDF export/import. This was already possible on several PDF documents, but is not possible