Help On Java Project

Hi Everyone,
I am in my final year of my computing degree, and left with the final year project which is so important to my final outcome. I am still undecided on what to do for my project. I was hoping you fellows could help me with some creative solutions.
The scope for the project is like this ().
- It should be able to do in 6 months.(which includes the documentations and reports and all you know ........... )
- It should have something that is new (you know like a new innovation, a new way of doing it)If its a tool then it should do something new, there should'nt be alternative tools existing that does the same purpose.
- It has to be software (Not Hardware, Network, Database, Architecture)
- I like the project to include most of the following (Cause these are my strengnths)
* Programming language - Java
* Database - SQL or Oracle
* Web Based (Using XML, XSL ...................... etc etc)
* Some thing where I can use AI techniques (Neural N, GeneticA)
I am losing Time ... I really hope you can give some wonderful ideas.
So many Thanks in Advance for all of you.
Shiran

A search engine, using a <insert AI feature here> to determing rank?
An Object Orintated Database, with SOAP interface.
A <insert ai> based robot using Lego Mindstormers and LeJOS and/or TinyVM.

Similar Messages

  • Collage Students need help with Java project(Email Server) whats analysis?

    Hi im studying in collage at the moment and i have just started learning java this semester, the thing is my teacher just told us to do an project in java , since we just started the course and i dont have any prior knowledge about java i was wondering if some one could help me with the project.
    i choose Email Sevice as my project and we have to submit an analysis and design document , but how the hell am i suppose to know what analysis is ? i just know we use ER diagrams & DFD's in the design phase but i dont know what analysis means ?
    could some one tell me what analysis on an email service might be? and what analysis on a subject means? is it the codeing involved or some thing coz the teacher told us not to do any codeing yet so im completly stumped,
    oh and btw we are a group of 3 students who are asking u the help here coz all of us in our class are stupmed ?

    IN case any one is interested this is the analysis i wrote
    ANALYSIS
    Analysis means figuring out what the problem is, maybe what kinds of solutions might be appropriate
    1.     Introduction:-
    The very definition of analysis is an investigation of the component parts of a whole and their relations in making up the whole. The Analysis done here is for an emailing service called Flashmail, the emailing service is used to send out mails to users registered with our service, these users and there log activities will be stored in some where, the most desirable option at this time is a Database, but this can change as the scope of the project changes.
    2.     Customer Analysis:-
    We are targeting only 30 registered users at the moment but this is subject to change as the scale changes of the project .Each user is going to be entitled to 1MB of storage space at this time since we lack the desired infrastructure to maintain anything higher than 1MB but the end vision of the project is to sustain 1000 MB of storage space while maintaining a optimal bandwidth allocation to each user so as to ensure a high speed of activity and enjoyment for the Customer.
    The Service will empower the user to be able to send, read, reply, and forward emails to there specified locations. Since we are working on a limited budget we can�t not at this time enable the sending of attachments to emails, but that path is also left open by modularity of java language, so we can add that feature when necessary.
    3.     Processor Load Analysis:-
    The number of messages per unit time processing power will be determined on hand with various algorithms, since it is best not to waste processor power with liberally distributing messages per unit time. Hence the number of messages will vary with in proportion to the number of registered users online at any given time.
    4.     Database Decision Analysis:-
    The High level Requirements of the service will have to be decided upon, the details of which can be done when we are implementing the project itself. An example of high level requirements are database management, we have chosen not to opt for flat files because of a number of reasons, first off a flat files are data files that contain records with no structured relationships additional knowledge is required to interpret these files such as the file format properties. The disadvantages associated with flat files are that they are not fast, they can only be read from top to bottom, and usually they have to be read all the way through. Though there is are advantages of Flat files they are that it takes up less space than a structured file. However, it requires the application to have knowledge of how the data is organized within the file.
    Good databases have key advantage over flat files concurrency. When you just read stuff from file it�s easy, but tries to synchronize multiple updates or writes into flat file from scripts that run in different process spaces.
    Whereas a flat file is a relatively simple database system in which each database is contained in a single table. In contrast, relational database systems can use multiple tables to store information, and each table can have a different record format.
    5.     Networking Analysis:-
    Virtually every email sent today is sent using two popular protocols known as SMTP (Simple Mail Transfer Protocol) and MIME (Multipurpose Internet Mail Extensions).
    1.     SMTP (Simple Mail Transfer Protocol)
    The SMTP protocol is the standard used by mail servers for sending and receiving email. In order to send email we will first establish a network connection to our SMTP server. Once you have finished sending your email message it is necessary that you disconnect from the SMTP server
    2.     MIME (Multipurpose Internet Mail Extensions)
    The MIME protocol is the standard used when composing email messages.

  • Devoloping project help for java projects

    hi
    we have done a project using java swings. now we need to provide project help documentation, and
    that help should be accessed from the menu.
    can u please give me any approch for this?
    thank u
    sarabh.

    You can start from this point.
    http://java.sun.com/developer/JDCTechTips/2002/tt0423.html

  • Help with Java project!!!

    Please help me out with this, I've written this as a start to my program about kids grades and it won't compile!! I've tried everything, I just have no clue why it won't work.
    // John: firsts.java
    import javax.swing.*;
    public class firsts {
    public static void main ( String args[] )
    { int Students;
    int firsts;int twoone; int twotwo; int third; int pass; int fail; int resultCounter; int result;
    int total;
    double average;
    String StudentsString;
    //initialisation
    firsts = 0;
    twotwo = 0;
    twoone = 0;
    third = 0;
    pass = 0;
    fail = 0;
    resultCounter = 0;
    total = 0;
    Students = 0;
    StudentsString = JOptionPane.showInputDialog ( "Enter number of students in the class (up to 20): " ) ;
    Students = Integer.parseInt( StudentsString);
    if ( Students <=-1 || >=21 ) JOptionPane.showMessageDialog ("No such Account Number", JOptionPane.ERROR_MESSAGE);
    else if ( Students == 0 ) System.exit(0) ;
    else JOptionPane.showMessageDialog("Class average is ", JOptionPane.INFORMATION_MESSAGE );
    ERROR REPORT:-
    C:\WINDOWS\Desktop\Johns Java>C:\j2sdk1.4.1\bin\javac firsts.java
    firsts.java:36: illegal start of expression
    if ( Students <=-1 || >=21 ) JOptionPane.showMessageDialog ("No such Account Number", JOptionPane.ERROR_MESSAGE);
    ^
    firsts.java:36: ')' expected
    if ( Students <=-1 || >=21 ) JOptionPane.showMessageDialog ("No such Account Number", JOptionPane.ERROR_MESSAGE);
    ^
    firsts.java:42: cannot resolve symbol
    symbol : method showMessageDialog (java.lang.String,int)
    location: class javax.swing.JOptionPane
    else JOptionPane.showMessageDialog("Class average is ", JOptionPane.INFORMATION_MESSAGE );
    ^
    3 errors
    What am I doing wrong? Please help!!!

    Again, I've been all around the bushes trying to alter this but I still get 13 errors! Everytime a mark is entered I am trying to add it into the correct category so that at the end I can see how many have firsts, seconds, thirds etc. I just cannot see what I'm doing wrong.
    // John: arp.java
    import java.awt.event.*;
    import javax.swing.*;
    public class arp extends JFrame {  public arp() 
    {    double average;   
    String StudentsString;
    // declaration and initialisation //
    int firsts = 0;
    int twotwo = 0;
    int twoone = 0;
    int third = 0;
    int pass = 0;
    int fail = 0;
    int resultCounter = 0;
    int total = 0;
    int Students = 0;
    int Studentmark;
    StudentsString = JOptionPane.showInputDialog(this,"Enter number of students in the class (up to 20): ");
    {      Students = Integer.parseInt(StudentsString);    }
    // could also write this as //
    if(Students <= -1 || Students >= 21)
    JOptionPane.showMessageDialog(null, "ERROR", "The number needs to be between 0-20", JOptionPane.ERROR_MESSAGE);
    else if(Students == 0)
    System.exit(0);
    else while (resultCounter <= Students) resultCounter ++;
    JOptionPane.showInputDialog(this,"Enter mark (0-100) for Student" + resultCounter + " :- ");
    { Studentmark = Integer.parseInt(StudentsString);}
    if (Studentmark >=70 && <=100) firsts++;
    else if (Studentmark >=60 && <=69) twoone++;
    else if (Studentmark >=50 && <=59) twotwo++;
    else if (Studentmark >=41 && <=49) third++;
    else if (Studentmark >=38 && <=40) pass++;
    else if (Studentmark >=37 && <=0) fail++;
    else JOptionPane.showMessageDialog(null, "ERROR", "The student mark needs to be between 0-100", JOptionPane.ERROR_MESSAGE);
    addWindowListener(new WindowAdapter() {     public void windowClosing(WindowEvent e) {       System.exit(0);     } }); //
    arp.java:44: illegal start of expression
    if (Studentmark >=70 && <=100) (firsts++);
    ^
    arp.java:44: ')' expected
    if (Studentmark >=70 && <=100) (firsts++);
    ^
    arp.java:46: illegal start of expression
    else if (Studentmark >=60 && <=69) (twoone++);
    ^
    arp.java:46: ')' expected
    else if (Studentmark >=60 && <=69) (twoone++);
    ^
    arp.java:48: illegal start of expression
    else if (Studentmark >=50 && <=59) (twotwo++);
    ^
    arp.java:48: ')' expected
    else if (Studentmark >=50 && <=59) (twotwo++);
    ^
    arp.java:50: illegal start of expression
    else if (Studentmark >=41 && <=49) (third++);
    ^
    arp.java:50: ')' expected
    else if (Studentmark >=41 && <=49) (third++);
    ^
    arp.java:52: illegal start of expression
    else if (Studentmark >=38 && <=40) (pass++);
    ^
    arp.java:52: ')' expected
    else if (Studentmark >=38 && <=40) (pass++);
    ^
    arp.java:54: illegal start of expression
    else if (Studentmark <=37 && >=0) (fail++);
    ^
    arp.java:54: ')' expected
    else if (Studentmark <=37 && >=0) (fail++);
    ^
    arp.java:58: '}' expected
    addWindowListener(new WindowAdapter() {     public void windowClosing(WindowEvent e) {       System.exit(0);     } }); // we can use pack() or setSize() here //pack(); setSize(300,200); setLocation(300,200); setVisible(true); } public static void main(String[] args) {    arp firsts = new arp();  }}
    ^
    13 errors

  • Need help on Java Project

    Ok, I'm in Computer Science 2 (Java Programming 2) and its been pretty much a year or maybe even more since I've done any programming. We've been handed out our first project, which is now due tomorrow, and I don't know why I waited last minute to do this but whatever. Anyway what it is is this is the problem:
    A small airline has decided to create a new automated system for reservations. You have been hired to write the program for this system. Customers will be allowed to request seats, or to cancel an existing reservation on a single flight of the airline's only plane which has a capacity of 10 seats.
    Ok so far I've created the project1 file, I've made classes, Seat class, Airplane class, and Application class. Right now I'm working on the Seat class which needs to store the type of seat first or coach, whether the seat is empty or occupied and the seat number. This is what I have so far in that class, and I am stuck. I know I need an accessor method to retrieve the number and type but how do i go about it.
    public class Seat
         int seatNum;
         String reserve;
         public Seat()
              reserve = new String();
              seatNum = 0;
    }

    no i'm not looking for someone to do it for me ... ok this is what i have now.
    public class Seat
         int seatNum;
         String reserve;
         public Seat()
              reserve = new String();
              seatNum = 0;
         public int getSeatNumber() {
             return seatNum;
         public String getReserve() {
              return reserve;
         public void setReserve(String reserve) {
              this.reserve = reserve;
    }

  • Help with java project... stuck!!!!

    Create a TrafficLight that models a traffic signal for a simple four-way intersection.
    In this kind of intersection, there are really only two directions of traffic flow, which for convenience I'll abbreviate as ns and ew for north-south and east-west. There's nothing fancy here; either ns traffic is moving or ew is moving, or the signal is in the failure state and is blinking red in all directions.
    Here's the outline of the new class, which I called FourWayTwoSignal for lack of any better ideas:
    � Data members: two Traffic Light objects for the two ns and ew directions.
    � Default constructor: Both lights start off red and non-blinking.
    � toString: Have the string representation of this new object use a format like: <ns:red, ew:green> where for each direction it shows either the color of the light or the word blink.
    � fail: Both lights go to blinking red.
    � reset: Both lights go to non-blinking red.
    � cycle: The light cycling is a little more complicated here, but can be broken down like this:
    o If both lights are blinking red, they stay that way (only a reset operation can fix this).
    o If both lights are non-blinking red (the initial or reset state), start the cycle going by cycling the ns light to green.
    o If one light is red and the other isn't (this is the normal operating state), cycle the non-red light to its next color. If this causes that light to change to red, then also cycle the other light so that the other traffic direction now sees green.
    1. Both blink
    2. Both red
    3. One red, the other green or yellow
    And note that combination 2 should only appear when the light is first created or just after a reset; as soon as you invoke the cycle operation, combination 2 changes to some variation of combination 3.
    this is the tester for the main
    public class FWTSTest {
         public static void main(String[] args) {
              FourWayTwoSignal fwts = new FourWayTwoSignal();
              System.out.println(fwts);
              System.out.println();
              for (int i = 1; i <= 14; i++) {
                   fwts.cycle();
                   System.out.println(fwts);
              System.out.println();
              fwts.fail();
              System.out.println(fwts);
              for (int i = 1; i <= 4; i++) {
                   fwts.cycle();
                   System.out.println(fwts);
              System.out.println();
              fwts.reset();
              System.out.println(fwts);
              for (int i = 1; i <= 4; i++) {
                   fwts.cycle();
                   System.out.println(fwts);
    [\code]
    i have created basicly what i need for one traffic light but i need help tweeking it so it can work with a four way one. there would basicly be one going ns (north south) and ew (east west)
    here is what i have so farpublic class TrafficLight {
         private int color = 2;
         private boolean Blink = false;
    public int getColor() {
    return color;
    public String getColorName() {
    if(color == 0)
                   return "green";
              else if(color == 1)
                   return "yellow";
              else if(color == 2)
                   return "red";
              else
    return null;
    public void cycleLight() {
    if(Blink == true)
         color = color;
         else if(color == 2)
              color = 0;
         else
              color = color + 1;
    public boolean isBlinking() {
    return Blink;
    public void reset() {
    color = 2;
              Blink = false;
    public void fail() {
    color = 2;
              Blink = true;
    public String toString() {
    return "<"+getColorName()+(isBlinking()? ", blinking":"")+">";
    [\code]
    this is all i have so far can someone help me get a better start?
    public class FourWayTwoSignal{
    public static void main(String[] args){
      fwts ns, ew;
    public FourWayTwoSignal(){
         ns = new fwts;
    public String toString() {
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Create a TrafficLight that models a traffic signal for a simple four-way intersection.
    In this kind of intersection, there are really only two directions of traffic flow, which for convenience I'll abbreviate as ns and ew for north-south and east-west. There's nothing fancy here; either ns traffic is moving or ew is moving, or the signal is in the failure state and is blinking red in all directions.
    Here's the outline of the new class, which I called FourWayTwoSignal for lack of any better ideas:
    � Data members: two Traffic Light objects for the two ns and ew directions.
    � Default constructor: Both lights start off red and non-blinking.
    � toString: Have the string representation of this new object use a format like: <ns:red, ew:green> where for each direction it shows either the color of the light or the word blink.
    � fail: Both lights go to blinking red.
    � reset: Both lights go to non-blinking red.
    � cycle: The light cycling is a little more complicated here, but can be broken down like this:
    o If both lights are blinking red, they stay that way (only a reset operation can fix this).
    o If both lights are non-blinking red (the initial or reset state), start the cycle going by cycling the ns light to green.
    o If one light is red and the other isn't (this is the normal operating state), cycle the non-red light to its next color. If this causes that light to change to red, then also cycle the other light so that the other traffic direction now sees green.
    1. Both blink
    2. Both red
    3. One red, the other green or yellow
    And note that combination 2 should only appear when the light is first created or just after a reset; as soon as you invoke the cycle operation, combination 2 changes to some variation of combination 3.
    this is the tester for the main
    public class FWTSTest {
         public static void main(String[] args) {
              FourWayTwoSignal fwts = new FourWayTwoSignal();
              System.out.println(fwts);
              System.out.println();
              for (int i = 1; i <= 14; i++) {
                   fwts.cycle();
                   System.out.println(fwts);
              System.out.println();
              fwts.fail();
              System.out.println(fwts);
              for (int i = 1; i <= 4; i++) {
                   fwts.cycle();
                   System.out.println(fwts);
              System.out.println();
              fwts.reset();
              System.out.println(fwts);
              for (int i = 1; i <= 4; i++) {
                   fwts.cycle();
                   System.out.println(fwts);
    }i have created basicly what i need for one traffic light but i need help tweeking it so it can work with a four way one. there would basicly be one going ns (north south) and ew (east west)
    here is what i have so far
    public class TrafficLight {
          private int color = 2;
          private boolean Blink = false;
        public int getColor() {
            return color;
        public String getColorName() {
            if(color == 0)
                     return "green";
                else if(color == 1)
                     return "yellow";
                else if(color == 2)
                     return "red";
                else
            return null;
        public void cycleLight() {
        if(Blink == true)
          color = color;
          else if(color == 2)
               color = 0;
          else
               color = color + 1;  
        public boolean isBlinking() {
            return Blink;
        public void reset() {
            color = 2;
                Blink = false;
        public void fail() {
            color = 2;
                Blink = true;
         public String toString() {
            return "<"+getColorName()+(isBlinking()? ", blinking":"")+">";
    this is all i have so far can someone help me get a better start?
    public class FourWayTwoSignal{
    public static void main(String[] args){
      fwts ns, ew;
    public FourWayTwoSignal(){
         ns = new fwts;
    public String toString() {

  • My first real life java project is going horribly wrong plz help

    my family has a marina and i said i can make a program to help my dad keep track of the boats and rentals etc. but the problem im having trouble im relatively new i have only been doing java for 3 weeks and its hard. My dad gave me an outline for the project. this is what i have so far.
    The File menu contains two items in addition to the Exit item from the JCreator template: Open and Save. The main tab will have other tabs added later.
    Step 2: Design and implement the Boat class:
    The Boat class describes a boat owned by the marina. Each boat has a name, a daily rental price and is moored in a slip at the marina. The marina need to keep track of each boat's status: 0 - available, 1 - reserved and 2 - rented. Slips are numbered from 1 to 6 right now, but the owners are thinking of adding more slips as their business grows. In designing this class, consider how the class will be used within the project. Try to think of all possible instance variables and methods your class might need.
    Review Topics:
    Creating classes: Instance variable, Get and Set Methods
    Menus
    Tabbed Panes
    Step 3: Design and implement the Marina class
    The marina class is used to hold all the Boat objects. Since there is no imaginable limit to the number of boats the marina might one day own, the Marina class should use an ArrayList object to hold all the Boat objects. Also implement the Open and Save menu items.
    Review Topics:
    The ArrayList class
    Object Files ... writing, reading, the Serializable interface
    Using the FileDialog class.
    Step 4: Design and implement the Customer and CustomerList classes.
    Each Customer is a Person who wants to rent a Boat. For identification purposes, each Customer is assigned a Customer number. This String value is a 6-digit number generated sequentially. That is, the first customer will be 000001, the second 000002, and so on. The Customer class must keep track of the Customer's Boat choices (past and present).
    The CustomerList class is a dynamic list of Customer objects. Customers come and go, so this class must have functionality that allows for the addition of new customers, deletion of customers and the editing of customer information, including changing their Boat rental options. Create methods within the CustomerList class that will read data from and write data to a data file.
    Add a new tab to the GUI allowing the user to enter a customer's first and last names, add these Customer objects to the CustomerList and save the Customer information on data files.
    i would prefer if you keep the code as simple as possible cause im new and i wont understand if you get all fancy.
    http://www.java-forums.org/new-java/8917-having-trouble-java-project.html you can find the attachment of the project files there.

    raakesh wrote:
    my family has a marina and i said i can make a program to help my dad keep track of the boats and rentals etc. but the problem im having trouble im relatively new i have only been doing java for 3 weeks and its hard.This is a real bad idea. The reason is that it's an enormous difference between a toy program and a professional product. You could get a version up and running in less than a week but it will be nowhere near what your dad envisioned. To meet even moderate expectations you'll have to put in at least 3-6 months fulltime. This is why bespoke software is so expensive. And even so there's a 90% chance the program will be dropped because your dad feels the manual system worked better. The only thing a project like this is likely to accomplish is to drive a wedge between you and your dad.
    I know you're bullshitting to get schoolwork help but still I want to warn others for this kind of projects. They're doomed.

  • Help Java project.

    know its horrible... I feel horrible about it; i'm still working on it but this Java project is killing me... Just so you know i dont have to know programing after this class, i just had a choice between 3 computer classes and picked the one i guess i'm worst at... I've done four major projects before this one. I average getting about 75% correct. We code in BlueJ...The reason i'm finally breaking down for help is it was due on November 21st. o well enough of my babble if ur going to help ur going to help; if not ur not.
    Heres the assignment
    Open the project cards containing your code for class PlayingCard and create the two new
    classes in this project space:
    Part 4: Implement class CardDeck that has the following declaration:
    public class CardDeck {
    private PlayingCard[] deck;
    public static final int DECK_SIZE = 52;
    //number of cards still in the deck:
    private int numCardsLeft;
    public CardDeck(){ ? }
    private void removeCard(int index){ ? }
    public void shuffle(){ ? }
    public void wholeDeck(){ ? }
    public PlayingCard topCard(){ ? }
    public PlayingCard anyCard() { ? }
    In your implementation, you must follow these guidelines:
    1. Constructor of the class must properly initialize the CardDeck object: create the array object with number of "compartments" equal to DECK_SIZE and assign it to the field deck ; then create all 52 cards in such a way that there are no duplicate cards in the deck. You must use Java loop(s) to create the above PlayingCard objects. In addition, the constructor must assign the value DECK_SIZE to the field numCardsLeft.
    2. Method removeCard(int index) must first check that the index is between 0 and the value of numCardsLeft-1. If it is true, then the method must
    ? shift all the cards in the deck array starting with index+1 and up to
    numCardsLeft-1 position left by one "compartment"
    ? set the last value in the deck to null, like so:
    deck[numCardsLeft-1] = null;
    ? decrement value of numCardsLeft by 1
    3. Method shuffle()randomly re-arranges cards in the deck:
    a) Declare a local variable temp of the type PlayingCard
    B) Generate two random numbers i and j between 0 (inclusive) and DECK_SIZE
    (exclusive) and swap the two cards stored at these index positions in the array:
    temp = deck;
    deck[i] = deck[j];
    deck[j] = temp;
    Repeat step B) at least 50 times, to get a good shuffle!
    4. Method wholeDeck() must display descriptions of all the cards in the deck on screen. In order to do this, use an enhanced for loop to iterate through the deck array, and for each PlayingCard element of it call method describeCard() of class PlayingCard.
    5. Method topCard()calls removeCard with 0 passed as the parameter value, and
    returns a copy of PlayingCard object that was removed (that is, the card that used to be at index 0 in the array, before we removed it).
    6. Method anyCard() removes a PlayingCard object stored at a random index in the
    array: using an object of class java.util.Random, generate a random number between 0 and numCardsLeft-1, and pass this value as the parameter to the method
    removeCard. Method anyCard must return a copy of the of PlayingCard object that
    was removed.
    Part 5: Implement class CardDeckTest that contains only the method
    public static void main (String[] args) which does the following:
    ? create an object of type CardDeck
    ? call the method wholeDeck()
    ? call the method shuffle()
    ? call the method wholeDeck() again
    ? call the method topCard(), store its result in a variable, and then use this variable to call method displayCard()of class PlayingCard
    ? call the method anyCard(), store its result in a variable, and then use this variable to call method displayCard()of class PlayingCard
    demo programs:
    use proper indentations

    can someone simplify the following code so that it works with my instructions? I had a friend (took this class before) help with the coding but he didnt have to use class deck.
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.lang.Character.Subset;
    public class Blackjack extends Applet implements ActionListener {
    String suit[] = {"H","C","D","S"};
    String cardvalue[] = {"A","2","3","4","5","6","7","8","9","10","J","Q","K" };
    int deck[] = { 1,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,38,39,40,41,42,43,44,45,46,47,48,49,50,51,0};
    Font suitfont = new Font("SansSerif",Font.BOLD,24);
    Font cardfont = new Font("Arial",Font.BOLD,24);     
    Font bigfont = new Font("Arial",Font.BOLD,36);     
    private Button hit = new Button(" Hit Me ");
    private Button stand = new Button(" Stand ");
    private Button deal = new Button(" Deal ");
    int clearscreen = 1;
    int card = 0;
    int housewins = 0;
    int playerwins = 0;
    int housepoints = 0;
    int playerpoints = 0;
    int housecards = 2;
    int playercards = 2;
    int turn = 0;
         public void init() {          
              add(hit);
         hit.addActionListener(this);
         add(stand);
         stand.addActionListener(this);     
         add(deal);
         deal.addActionListener(this);
         shuffle();
         card = 0;
         public void shuffle() {
         for(int i=0;i<1000;++i)
              int a = (int)(Math.random()*52.0);
              int b = (int)(Math.random()*52.0);
              int temp = deck[a];
              deck[a] = deck;
              deck[b] = temp;
         public void paint(Graphics g) {
    Image temp1 = getImage(getDocumentBase(),"s1.gif");
    Image temp2 = getImage(getDocumentBase(),"s2.gif");
    Image temp3 = getImage(getDocumentBase(),"s3.gif");
    Image temp4 = getImage(getDocumentBase(),"s4.gif");
    Image[] thesuit = {temp1, temp2, temp3, temp4};
              /* if(clearscreen==1) {
              g.fillRect(0,0,500,350);
              clearscreen = 0;
              setBackground(Color.green);
              g.setFont(bigfont);
              g.setColor(Color.blue);
              g.drawString("House", 50, 80 );
              g.drawString("Player", 50, 200 );
              g.drawString("Wins",370, 80);          
              g.drawString(Integer.toString(housewins),400,170);
              g.drawString(Integer.toString(playerwins),400,290);
              g.setFont(suitfont);
              if(((deck[card + 1] / 13) == 3) || ((deck[card + 1] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 1] % 13] , 100 , 120 );
              g.drawImage(thesuit[deck[card + 1] / 13] ,130, 100 ,this);
              if(((deck[card + 2] / 13) == 3) || ((deck[card + 2] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 2] % 13] , 20 , 240 );
              g.drawImage(thesuit[deck[card + 2] / 13] ,50, 220 ,this);
              if(((deck[card + 3] / 13) == 3) || ((deck[card + 3] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 3] % 13] , 100 , 240 );
              g.drawImage(thesuit[deck[card + 3] / 13] ,130, 220 ,this);          
    if (playercards>2) {
    if(((deck[card + 4] / 13) == 3) || ((deck[card + 4] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 4] % 13] , 180 , 240 );
              g.drawImage(thesuit[deck[card + 4] / 13] ,210, 220 ,this);               
    if (playercards>3) {
    if(((deck[card + 5] / 13) == 3) || ((deck[card + 5] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 5] % 13] , 260 , 240 );
              g.drawImage(thesuit[deck[card + 5] / 13] ,290, 220 ,this);               
    if (playercards>4) {
    if(((deck[card + 6] / 13) == 3) || ((deck[card + 6] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 6] % 13] , 340 , 240 );
              g.drawImage(thesuit[deck[card + 6] / 13] ,370, 220 ,this);               
    if (housecards>2) {
    if(((deck[card +  playercards + 2] / 13) == 3) || ((deck[card + playercards + 2] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + playercards + 2] % 13] , 180 , 120 );
              g.drawImage(thesuit[deck[card + playercards + 2] / 13] ,210, 100 ,this);               
    if (housecards>3) {
    if(((deck[card + playercards + 3] / 13) == 3) || ((deck[card + playercards + 3] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + playercards + 3] % 13] , 260 , 120 );
              g.drawImage(thesuit[deck[card + playercards + 3] / 13] ,290, 100 ,this);               
    if (housecards>4) {
    if(((deck[card + playercards + 4] / 13) == 3) || ((deck[card + playercards + 4] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + playercards + 4] % 13] , 340 , 120 );
              g.drawImage(thesuit[deck[card + playercards + 4] / 13] ,370, 100 ,this);               
              g.setColor(Color.red);
              g.drawString("Your Points: " , 20, 290 );
              g.drawString("House Points: " , 20, 160 );     
              playerpoints = 0;
              int wasace = 0;
              for(int i=2;i<(playercards+2);++i)
                   int cardvalue = 1 + deck[card +  i] % 13;
                   if(cardvalue < 11)
                        playerpoints = playerpoints + cardvalue;
                   if(cardvalue > 10)
                        playerpoints = playerpoints + 10;
                   if((cardvalue == 1) && (playerpoints < 12))
                   {  wasace=1;
                        playerpoints = playerpoints + 10;
              if((wasace==1)&&(playerpoints>21))
                   playerpoints = playerpoints - 10;
              if(playerpoints>21) {
              turn=1;
              g.drawString("Bust" , 320, 290 );
              if((playerpoints==21)&&(playercards==2)) {
              turn=1;
              g.drawString("BlackJack" , 240, 290 );
              if(turn==0)
              g.drawString("? ?" , 20 , 120 );
              else
              if(((deck[card] / 13) == 3) || ((deck[card] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card ] % 13] , 20 , 120 );
              g.drawImage(thesuit[deck[card ] / 13] , 50, 100 ,this);
              housepoints = 0;
              wasace=0;
              for(int i=0;i<2;++i)
                   int cardvalue = 1 + deck[card +  i] % 13;
                   if(cardvalue < 11)
                        housepoints = housepoints + cardvalue;
                   if(cardvalue > 10)
                        housepoints = housepoints + 10;
                   if((cardvalue == 1) && (playerpoints < 12))
                   { wasace=1;
                        housepoints = housepoints + 10;}
              for(int i=2;i<housecards;++i)
                   int cardvalue = 1 + deck[card +  i + playercards] % 13;
                   if(cardvalue < 11)
                        housepoints = housepoints + cardvalue;
                   if(cardvalue > 10)
                        housepoints = housepoints + 10;
                   if((cardvalue == 1) && (housepoints < 12)) {
                        wasace=1;
                        housepoints = housepoints + 10;}
              if((wasace==1)&&(housepoints>21))
                   housepoints = housepoints - 10;
              if((housepoints<16) && (turn==1) &&(playerpoints<22)&& (!((playerpoints==21)&&(playercards==2))))
                   ++housecards;
                   repaint();
              g.drawString(Integer.toString(playerpoints) , 190,290 );     
              if(turn==1)
                   g.drawString(Integer.toString(housepoints) , 190,160 );     
              if(housepoints>21)           
              g.drawString("Bust" , 320, 160 );
    public void actionPerformed(ActionEvent e)
              if(e.getSource() == hit) {
                   if((turn==0)&&(playercards<5))
                   ++playercards;
                   repaint();
              if(e.getSource() == stand) {
                   if(playerpoints>13)
                   turn = 1;
                   repaint();
              if(e.getSource() == deal) {
                        card = card + playercards + housecards;
                        if(card>40)
                             shuffle();
                             card=0;
                   if(((playercards==2)&&(playerpoints==21))||(playerpoints>housepoints)||((playerpoints<22)&&(playercards==5)))
                        ++playerwins;
                   else
                        ++housewins;
                   playercards = 2;
                   housecards = 2;
                   turn = 0;
                   repaint();

  • Working on first Java project in Ecplise and need some help

    I am working on a Java project. I am working a programme to show sets of requirements to a software engineer. At the end the programme will show all consistent requirements with no conflicts between them.
    I am working on the first section. This invloves creating a class with a HashSet to insert the requirements in to the class. I am using this code at the moment
    import java.util.HashSet;
    import java.util.Set;
    public class requirements {
         public void HashSet() {
              Set<String> requirements = new HashSet<String>();
              //Declare some string items
              String item_1 = "r1";
              String item_2 = "r2";
              String item_3 = "r3";
              boolean result;
              //Add the items to the Set
              result = requirements.add(item_1);
              System.out.println(item_1 + ": " + result);
              result = requirements.add(item_2);
              System.out.println(item_2 + ": " + result);
              result = requirements.add(item_3);
              System.out.println(item_3 + ": " + result);
              //Now we try to add item_1 again
              result = requirements.add(item_1);
              System.out.println(item_1 + ": " + result);
              //Adding null
              result = requirements.add(null);
              System.out.println("null: " + result);
              //Adding null again
              result = requirements.add(null);
              System.out.println("null: " + result);
         public static void main(String[] args) {
              new requirements().HashSet();
    the class is called requirements and I get these errors
    Return type of the method is missing
    Syntax error on token class, delete this token
    Syntax error on token misplaced construct
    Syntax error insert Enum body to complete EnumheaderName
    Syntax Error insert Enum body to complete enum decleration
    The public type requirements must be defined in its own file.
    The next stage would be to send the Hashset to another class to perform operation on the set. The other class is called specification. Can anyone help me to resolve the errors and pass the set to the other class.
    Thanks

    muj wrote:
    I am working on a Java project. I am working a programme to show sets of requirements to a software engineer. At the end the programme will show all consistent requirements with no conflicts between them.
    I am working on the first section. This invloves creating a class with a HashSet to insert the requirements in to the class. I am using this code at the moment
    import java.util.HashSet;
    import java.util.Set;
    public class requirements {
         public void HashSet() {
              Set<String> requirements = new HashSet<String>();
              //Declare some string items
              String item_1 = "r1";
              String item_2 = "r2";
              String item_3 = "r3";
              boolean result;
              //Add the items to the Set
              result = requirements.add(item_1);
              System.out.println(item_1 + ": " + result);
              result = requirements.add(item_2);
              System.out.println(item_2 + ": " + result);
              result = requirements.add(item_3);
              System.out.println(item_3 + ": " + result);
              //Now we try to add item_1 again
              result = requirements.add(item_1);
              System.out.println(item_1 + ": " + result);
              //Adding null
              result = requirements.add(null);
              System.out.println("null: " + result);
              //Adding null again
              result = requirements.add(null);
              System.out.println("null: " + result);
         public static void main(String[] args) {
              new requirements().HashSet();
    the class is called requirements and I get these errors
    Return type of the method is missing
    Syntax error on token class, delete this token
    Syntax error on token misplaced construct
    Syntax error insert Enum body to complete EnumheaderName
    Syntax Error insert Enum body to complete enum decleration
    The public type requirements must be defined in its own file.
    The next stage would be to send the Hashset to another class to perform operation on the set. The other class is called specification. Can anyone help me to resolve the errors and pass the set to the other class.
    ThanksReading your code, it looks wrong... but it turns out that a lot of it was because you did not use CODE brackets like this:
    {+code}
    System.out.println("hello");
    {code+}
    becomes
       System.out.println("hello");It also seems that you code works as it is.
    though I recommend putting classes inside a package.
    Syntax error insert Enum body to complete EnumheaderNameWhere is this even in your code? Did you post the code you had a problem with?

  • How to use BO SDK in local java project?

    Hi,
    I am trying to connect BO system using below mentioned code
    public void main(String args[]) throws SDKException {
         try
              System.out.println("main");
              /ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();/
              IEnterpriseSession boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( "Administrator","","BOSAP","secEnterprise");
              IInfoStore boInfoStore =(IInfoStore) boEnterpriseSession.getService("InfoStore");
              ChangePWD(boEnterpriseSession, boInfoStore);
         }catch(Exception e)
              System.out.println("Exceptions in main");
              System.out.println(e);
    This code was taken from below mentioned thread:
    Force all users to change their Enterprise passwords with a batch operation
    I have created standalone java project and running as JAVA application in eclipce. I am getting class def not found error for these BO SDK jar files. I have added
    cecore.jar
    celib.jar and
    cesession.jar files as external lib to java project
    I am using following imports
    import com.crystaldecisions.sdk.framework.CrystalEnterprise;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.exception.SDKException;
    import com.crystaldecisions.sdk.occa.infostore.*;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
    import com.crystaldecisions.sdk.plugin.desktop.user.IUser;
    Does any one know solution to fix class def not found error?
    Thanks
    Nitesh Shelar

    I did some mistake few dependent jars were missing in project build path. After adding those missing BO jar files. Now its giving server connection error. Which I am trying to resolve.
    Thanks for your help.
    Nitesh Shelar

  • Best Practices for Defining NDS Java Projects...

    We are doing a Proof of Concept on using NDS to develop non-SAP Java applications.  We are attempting to determine if we can replace our current Java development tools with NDS/WAS.
    We are struggling with SAP's terminology and "plumbing" for setting up/defining Java projects.  For example, what is and when do you define Tracks, Software Components, Development Components, etc.  All of these terms are totally foreign to us and do not relate to our current Java environment (at least not that we can see).  We are also struggling with how the DTR and activities tie in to those components.
    If any one has defined best practices for setting up Java projects or has struggled with and overcome these same issues, please provide us with some guidance.  This is a very frustrating and time-consuming issue for us.
    Thank you!!

    Hi Peggy,
    In Component Model we divide software projects into small components.Components can use other components in well defined manner.
    A development object is a part of a component that can be changed or developed in some way; it provides the component with a certain part of its functionality. A development object may be a Java class, a Web Dynpro view, a table definition, a JSP page, and so on. Development objects are always stored as “sources” in a repository.
    A development component can be defined as a frame shared by a number of objects, which are part of the software.
    Software components combine components (DCs) to larger units for delivery and deployment.
    A track comprises configurations and runtime systems required for developing software component versions.It ensures stable states of deliverables used by subsequent tracks.
    The Design Time Repository is for versioning source code management. Distributed development of software in teams. Transport and replication of sources.
    You can also find lot of support in SDN for the above concepts with tutorials.
    Refer this Link for a overview on Java development Infrastructure(JDI)
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/java development infrastructure jdi overview.pdf
    To understand further
    Working with Net Weaver Development Infrastructure :
    http://help.sap.com/saphelp_nw04/helpdata/en/03/f6bc3d42f46c33e10000000a11405a/content.htm
    In the above link you can find all the concepts clearly explained.You can also find the required tutorials for development.
    Regards,
    Vijith

  • How to create the exe file for java project.

    How to create the exe file for java project.
    am done the project in java swing , i like to create the project in exe format, so any one help for me,
    send the procedure for that.
    thanking u.

    How to create the exe file for java project.Have you ever heard of google? I pasted your exact "question" into a google search:
    http://www.google.com/search?q=How+to+create+the+exe+file+for+java+project.
    and got several useful links.
    Better search terms might yield even better results.
    Sheesh.

  • How to Debug a Java Project in Eclipse using Tomcat6.0

    Hi
    Can anybody help me with the following questions.
    1.How to create a java project in eclipse(I am using jsp,servlets,jsf,spring,jasper,struts).
    2.How to debug my application in Eclipse Europa by putting break points.
    3.how should i add Tomcat6.0 to my project in order to debug my application so that i can put break points while running the applications and observe the values.
    Thanks
    Bala

    You may find this tutorial useful regarding to JSF, Eclipse and Tomcat: http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html
    To put breakpoints, just doubleclick on the left gray rule of the code, you'll get blue bullets at the left rule, indicating a break point. Run Tomcat in debug modus (rightclick Tomcat � debug). Use the Eclipse debug perspective to step in the code (window � open perspective � debug).

  • Need help for my project(how to call function in ancestor object)

    dear all, i need your help for my project.My problem is stated as follow:
    say i have a class call frameA and frameB, both of them are extend from
    JFrame, frameA structure can be described briefly as follow:
    //frameA.java
    public class frameA extends JFrame{
    private frameB fb;
    public frameA()
    fb=new frameb();
    show();
    public void func()
    JOptionPane.showMessageDialog(null,"OK");
    now, my problem raised, after frameA and fb is created, how can i access the ancestor object(which is frameA) within fb's code,
    what should i add inside frameB? i need the answer urgently......
    thanx a lot!!!
    cheers

    Hi,
    For this kind of problem, I believe you can use the inner class.
    Here's the sample code I hope will help:
    class MyApp{ 
    B bFrame;
    A aFrame;
    class A extends JFrame{
    public void doSomething(){
    bFrame = new B();
    bFrame.doSomething();
    class B extends JFrame{
    public void doSomething(){
    aFrame = new A();
    aFrame.doSomething();
    If you have further question, you can email me your task sample code at [email protected] and I will solve it for you.
    With my best,
    Zike Huang(Jim)

  • Using a java project in a web which is part of a ear

    hi
    i have an ear (jspkeepEAR) that includes a web project (jspkeep). The web project uses a java project (common).
    I don't want the EAR to know about the common, so i've added the common as a j2ee module to the web project.
    when publishing, i can see under
    C:\bea92\user_projects\w4WP_workspaces\Untitled\.metadata\.plugins\org.eclipse.core.resources\
    .projects\jspkeepEAR\beadep\workshop\jspkeepEAR
    the .beabuild.txt file:
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeepEAR/EarContent/APP-INF/classes = APP-INF/classes
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeep/WebContent = jspkeep.war
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeep/build/classes = jspkeep.war/WEB-INF/classes
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeep/build/jws/.src = jspkeep.war/WEB-INF/classes
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/common = jspkeep.war/WEB-INF/lib/common.jar
    the problem is, when i'm surfing to a servlet in the web, i get NoClassDefFoundError for classes in the common.
    I've also noticed that if i publish the web project by itself (and not as part of the ear), it works fine.
    any idea?
    thanks
    yair
    Edited by reformy at 12/12/2006 2:24 AM

    Hi Yair
    It appears that WLS only supports mapping a directory to a jar in APP-INF/lib/
    C\:/runtime-New_configuration/Common/bin = APP-INF/lib/Common.jar
    but NOT to a jar in WEB-INF/lib.
    Engineering will look into it sometime to fix it.
    Workaround Suggested:
    As a workaround, you can include the Java/Utility project as part of the EAR and set as dependent J2EE module to the Web project.
    Hope this helps.
    Vimala-

Maybe you are looking for