PLEASE HELP ME. THIS PROGRAM IS KILLING ME.

Hi. I am getting so sick of this program. I have been trying to do it for the past couple of weeks and I am getting nowhere. I really wish someone can help me on it ... like totaly help me on it. I am getting so frustrated. I would appreciate all the help.
This is the program:
In Belageusia, a plorg has these properties:
Data:
     A plorg has a name
     A plorg has a contentment index (CI), which is an integer between 0 and 100
The population of plorgs in Belagersia is further subdivided into three mutually exclusive classes: Plebeians, Equidians, and Elitians.
A Plorg?s stature is completely determined by their contentment index and witht that designation comes certain burdens and/or advantages.
Plebeians have a contentment index in [0, 24].
Each new Plebeian is welcomed with a contentment index of 2 and burdened with a debt of $10.00
Plebeians never manage to break even, so they have no taxes imposed upon them. Furthermore, since they can never get out debt, they cannot accumulate any wealth.
Equidians have a contentment index in [25, 75]
Each new Equidian is welcomed with a contentment index of 50 and burdened with taxes of $20.00
Equidians have taxes imposed upon them. Furthermore, since they do manage to break even, they have no debt. However, since they only manager to break even, they do not accumulate any wealth.
Elitians have a contentment index in [76, 100]
Each new Elitian is welcomed with a contentment index of 87 and burdened with taxes of $20.00, but also provided with a ?silver spoon? of $30.00 in accumulated wealth.
Elitians manage to expand upon their wealth, sot hey have taxes imposed upon them. Furthermore, since they are accumulating wealth, they have no debt.
At each interim time epoch the population of Belageusia retracts with a death rate randomly selected between 0% and 10%. If a plorg survives the purge, they have an opportunity to move one class higher and/or one class lower. However, remember that a plorg?s name is final. It never changes.
For Plebeians this is transition is determined by randomly selecting a CI in [0, 49]. If this new CI is les than 25 then the plorg remains a Plebeian, with this newly assigned CI, and their debt increases 3.7%. If this new CI is in [25, 49], the Plebeian ascends to a Equidian, with this newly assigned CI, their debt is forgiven, but taxes of $20 are assessed.
For Equidians this is determined by randomly selecting a CI in [0,100].
If this new CI is in [25, 75] then the plorg remains a Equidian, with this newly assigned CI, but their taxes are increased 6.1%.
If this new CI is in [0, 24] then the plorg becomes a Plebeian, with this newly assigned CI, their taxes are forgiven, but they are burdened with a debt of $10.00.
If this new CI is in [76, 100] then the plorg becomes a Plebeian, with this newly assigned CI, but their taxes are increased 6.1%. However, they are bewtowed a wealth of $30.00.
For Eletians this is determined by randomly selecting a CI in [51, 100]. If this new CI is greater than 76 then the plorg remains an Eletian, with this newly assigned CI, their taxes increase 6.1% and their wealth increases 4.9%. If this new CI is in [51, 75], then this plorg becomes an Equidian, with this newly assigned CI, their wealth is eliminated, and their taxes are increased 6.1%.
At each time epoch, the population of Belageusia at a birth rate randomly selected between 0% and 10%. A randomly chosen number between 0-100 determines each newly born plorg?s stature. If this random number is in the range 0-24, create a new Plebeian. In the range 25-75, create a new Equidian, and if in the range 76-100, create a new Elitian.
We are supposed to output the population characteristics of Belageusia, after 1000 time epochs.
This is the code that I wrote down but got no where with:
import javax.swing.*;
import java.util.*;
import java.text.*;
public class Belageusiaplorg
     public static void main (String[] args)
          ArrayList Plebs = new ArrayList(350);
          ArrayList Equids = new ArrayList(600);
          ArrayList Elits = new ArrayList(350);
          ArrayList Holding = new ArrayList(600);
          for (int i=0; i<25; i++)
               Plebs.add(new plebian());
          for (int i=0; i<50; i++)
               Equids.add(new equidian());
          for (int i=0; i<25; i++)
               Elits.add(new Elitian());
          long population = Plebs.size() + Equids..size() + Elits.size();
          System.out.println("Current Belageusia Population is "+population);
          System.out.println("Current Plebeians Population is "+Plebs.size);
          System.out.println("Current Equidians Population is "+Equids.size);
          System.out.println("Current Elitians Population is "+Elits.size);
          Random generator = new Random();
          int x = generator.nextInt(11);
          for (int j=0; j=plebs.size(); j++)
               System.out.println(Plebs.g(j));
          long Equids_size = Equids.size();
          long Elits_size = Elits.size();
          for(int j=1; j<Plebs.size(); j++)
               Plebian e = (Plebian) Plebs.get(j);
               int new_ci = generator.nextInt(50);
               if (new_ci < 25)
                    e.setCI(new_ci);
                    e.raiseDebt();
               else
                    Plebs.rename(j);
                    Equids.add(new Equidian(e.getName().newCI));
                    j++;
          for(int j=0; j < Equids.size; j++)
               Equidian e = (Equidian) Equids.get(j);
               int newCI = generator.nextInt(101);
               if(new_ci < 25)
                    Equids.remove(j);
                    Plebs.add(nwe Plebian(e.getName().new_ci));
                    Equids_size --;
                    j++;
               else
               if (new_ci > 75)
                    Equids.remove(j);
                    Elitian f = new Elitian(e.getName(),new_ci,e.getTaxes());
                    Elits.add(f);
                    Equids_size --;
                    j--;
               else
                    e.setCI(new_CI);
                    e.raiseTaxes();
          for (int j=0; j<Elits.size; j++)
               Elitian e = (Elitian) Elits.get(j);
               int ci = e.getCI();
               int r = generator.nextINT(50);
               int new_ci = 51+r;
               if(new_ci > 75)
                    e.setCI(new_ci);
                    e.raisetaxes();
                    e.raisewealth();
               else
                    Elitians.remove(j);
                    Equidian g = new Equidian(e.getName(), new_ci);
                    g.raisetaxes();
                    Equids.add(g);
                    Elits_size --;
                    j--;
          if(deathrate != 0)
               int multiple = 100/deathrate;
               int count 1;
               for (int j=0; j=Plebs.size(); j++)
                    if(count % multiple == 0)
                         Plebs.remove(j);
                         j--;
                    count++;
class Plorg
     private final String name;
     private int CI;
     private static long nextID = 1;
     public Plorg()
          name = "Plorg" + nextID;
          nextID++;
     public Plorg(int CI)
          name = "Plorg" + nextID;
          nextID++;
          this.CI = CI;
     public Plorg (String name, int CI)
          this.name = name;
          this.CI = CI;
     public void setCI(int new_CI)
          CI = new_CI;
     public String getName()
          return name;
     public int getCI()
          return CI;
     public Plorg Plebs()
     public Plorg Equids()
     public Plorg Elits()

Sounds a lot like a homework question to me. Still it was interesting enough to try out. I have not tried to change your code, just made one of my own. Here is my solution. I have made the Plorg class an inner class of the Belageusia. This is just so I dont have to put up two java files. You could easily split it into two though.
import java.util.Random;
import java.util.ArrayList;
import java.util.Iterator;
* @author Jonathan Knight
public class Belageusia
    /** Random number generator - Seeded with the current time. */
    private static Random random = new Random(System.currentTimeMillis());
    /** A list of all of the Plorgs */
    private ArrayList population = new ArrayList();
    /** A list of all of the Plebians. */
    private ArrayList plebians = new ArrayList();
    /** A list of all of the Equidians. */
    private ArrayList equidians = new ArrayList();
    /** A list of all of the Elitians. */
    private ArrayList elitians = new ArrayList();
    /** A count of the Epochs that have passed */
    private int epochs = 0;
     * Main method.
     * Create a new world of Belageusia and run it for 1000 epochs.
    public static void main(String[] args)
        Belageusia world;
        world = new Belageusia();
        for (int i = 0; i < 1000; i++)
            world.epoch();
        System.out.println("The Belageusia population after 1000 epochs");
        world.printPopulation();
     * Create a new World of Belageusia and create some Plorgs to live there.
     * The world will be created with 25 Plebians, 50 Equidians and 25 Elitians.
    public Belageusia()
        for (int i = 0; i < 25; i++)
            plebians.add(Plorg.createPlebian());
        for (int i = 0; i < 50; i++)
            equidians.add(Plorg.createEquidian());
        for (int i = 0; i < 25; i++)
            elitians.add(Plorg.createElitian());
     * Print the current population to System.out
    public void printPopulation()
        int total;
        int plebianCount;
        int equidianCount;
        int elitianCount;
        plebianCount = plebians.size();
        equidianCount = equidians.size();
        elitianCount = elitians.size();
        total = plebianCount + equidianCount + elitianCount;
        System.out.println("Current Belageusia population is " + total);
        System.out.println("Current Plebian population is " + plebianCount);
        System.out.println("Current Equidian population is " + equidianCount);
        System.out.println("Current Elitian population is " + elitianCount);
     * At each interim time epoch the population of Belageusia retracts with a death rate
     * randomly selected between 0% and 10%. If a plorg survives the purge, they have an
     * opportunity to move one class higher and/or one class lower. However, remember that
     * a plorgs name is final. It never changes.
     * For Plebeians this transition is determined by randomly selecting a CI in [0, 49].
     * If this new CI is les than 25 then the plorg remains a Plebeian, with this newly assigned CI,
     * and their debt increases 3.7%. If this new CI is in [25, 49], the Plebeian ascends to a
     * Equidian, with this newly assigned CI, their debt is forgiven, but taxes of $20 are assessed.
     * For Equidians this is determined by randomly selecting a CI in [0,100].
     * If this new CI is in [25, 75] then the plorg remains a Equidian, with this newly assigned CI,
     * but their taxes are increased 6.1%.
     * If this new CI is in [0, 24] then the plorg becomes a Plebeian, with this newly assigned CI,
     * their taxes are forgiven, but they are burdened with a debt of $10.00.
     * If this new CI is in [76, 100] then the plorg becomes a Plebeian, with this newly assigned CI,
     * but their taxes are increased 6.1%. However, they are bewtowed a wealth of $30.00.
     * For Eletians this is determined by randomly selecting a CI in [51, 100].
     * If this new CI is greater than 76 then the plorg remains an Eletian, with this newly assigned CI,
     * their taxes increase 6.1% and their wealth increases 4.9%. If this new CI is in [51, 75],
     * then this plorg becomes an Equidian, with this newly assigned CI, their wealth is eliminated,
     * and their taxes are increased 6.1%.
     * At each time epoch, the population of Belageusia at a birth rate randomly selected between 0% and 10%.
     * A randomly chosen number between 0-100 determines each newly born plorg?s stature.
     * If this random number is in the range 0-24, create a new Plebeian. In the range 25-75, create a new Equidian,
     * and if in the range 76-100, create a new Elitian.
    public void epoch()
        ArrayList newPlebians = new ArrayList();
        ArrayList newEquidians = new ArrayList();
        ArrayList newEletians = new ArrayList();
        Iterator it;
        Plorg plorg;
        int deathRate;
        double deathCount;
        int birthRate;
        double birthCount;
        int population;
        int subClass;
        int newCI;
        int kill;
        epochs++;
        System.out.println("Epoch = " + epochs);
        printPopulation();
        population = plebians.size() + equidians.size() + elitians.size();
        // The death rate is random 0 to 10%
        deathRate = random.nextInt(11);
        // work out the death count. population is cast to a double to avoid rounding errors
        deathCount = (double)population * deathRate / 100;
        // round up the result. We do this as once the population falls below 10
        // we would never kill anything
        deathCount = Math.ceil(deathCount);
        // We now work out the birth rate based on the population before we kill
        // anything otherwise the population tends to go down and down
        // The birth rate is random 0 to 10%
        birthRate = random.nextInt(11);
        // work out the birth count. population is cast to a double to avoid rounding errors
        birthCount = Math.ceil((double)population * birthRate / 100);
        // As with the deathCount round up the result.
        // We do this as once the population falls too low we would never create any more
        birthCount = Math.ceil(birthCount);
        System.out.println("About to kill " + deathRate + "% which is " + deathCount + " Plorgs out of " + population);
        for(int i=0; i<deathCount; i++)
            // get a random number between 0 and 2
            kill = random.nextInt(population);
            population--;
            // kill the specified Plorg
            if( kill < plebians.size() )
                // kill a random Plebian
                plebians.remove( random.nextInt(plebians.size()) );
            else if( kill < plebians.size() + equidians.size() )
                // kill a random Equidian
                equidians.remove( random.nextInt(equidians.size()) );
            else
                // kill a random Elitian
                elitians.remove( random.nextInt(elitians.size()) );
        System.out.println("Transitioning Plebians");
        // Transition period for Plebians
        it = plebians.iterator();
        while ( it.hasNext() )
            plorg = (Plorg) it.next();
            // select a new CI from 0 to 49 at random
            newCI = random.nextInt(50);
            plorg.setCI(newCI);
            if( newCI < 25 )
                // Oh dear, this one stays as a Plebian; increase its dept by 3.7%
                plorg.setDept( plorg.getDept() * 1.037 );
            else
                // Congratulations this one is now an Equidian
                newEquidians.add(plorg);
                // remove from the Plebian list.
                // NOTE we must do the remove via the Iterator
                it.remove();
                plorg.setDept(0);
                plorg.setTaxes(20);
        System.out.println("Transitioning Equidians");
        // Transition period for Equidians
        it = equidians.iterator();
        while ( it.hasNext() )
            plorg = (Plorg) it.next();
            // select a new CI from 0 to 100 at random
            newCI = random.nextInt(101);
            plorg.setCI(newCI);
            if( newCI < 25 )
                // Oh dear, this one becomes a Plebian
                newPlebians.add(plorg);
                // remove from the Equidian list.
                // NOTE we must do the remove via the Iterator
                it.remove();
                plorg.setDept( 10 );
                plorg.setTaxes(0);
            else if( newCI < 25 )
                // This one stays as an Equidian; increase its taxes by 6.1%
                plorg.setTaxes( plorg.getTaxes() * 1.061 );
            else
                // Congratulations this one is now an Eletian
                newEletians.add(plorg);
                // remove from the Equidian list.
                // NOTE we must do the remove via the Iterator
                it.remove();
                plorg.setWealth(30);
                // Increase its taxes by 6.1%
                plorg.setTaxes( plorg.getTaxes() * 1.061 );
        System.out.println("Transitioning Elitians");
        // Transition period for Eletians
        it = plebians.iterator();
        while ( it.hasNext() )
            plorg = (Plorg) it.next();
            // Always increase taxes by 6.1%
            plorg.setTaxes( plorg.getTaxes() * 1.061 );
            // select a new CI from 51 to 100 at random
            newCI = 51 + random.nextInt(50);
            plorg.setCI(newCI);
            if( newCI > 76 )
                // This one stays as an Eletian; increase its wealth by 4.9%
                plorg.setWealth( plorg.getWealth() * 1.049 );
            else
                // Oh dear, this one becomes an Equidian
                newEquidians.add(plorg);
                // remove from the Plebian list.
                // NOTE we must do the remove via the Iterator
                it.remove();
                // emove its wealth
                plorg.setWealth(0);
        // now assign the Plorgs that are transitioning
        plebians.addAll(newPlebians);
        equidians.addAll(newEquidians);
        elitians.addAll(newEletians);
        System.out.println("Creating " + birthRate + "% new Plorgs from " + population + " which is " + birthCount);
        //create the new Plorgs
        for (int i = 0; i < birthCount; i++)
            // get a random number between 0 and 100
            subClass = random.nextInt(101);
            // create the specified Plorg
            if( subClass <= 24 )
                plorg = Plorg.createPlebian();
                plebians.add(plorg);
            else if( subClass >= 25 && subClass <= 75 )
                plorg = Plorg.createEquidian();
                equidians.add(plorg);
            else
                plorg = Plorg.createElitian();
                elitians.add(plorg);
    public static class Plorg
        /** Identifier used to generate unique names */
        private static int id = 0;
        /** The Plorgs name */
        private final String name;
        /** The level of wealth for this Plorg */
        private double wealth = 0;
        /** The level of dept for this Plorg */
        private double dept = 0;
        /** The level of taxes for this Plorg */
        private double taxes = 0;
        /** This Plorgs contentment index */
        private int ci = 0;
        /** Create a new Plorg with the given CI.
         * This is a private constructor. The only way for a program to
         * create new Plorgs is by calling either createPlebian(),
         * createEquidian() or createElitian().
         * @param ci
        private Plorg(int ci)
            // Generate a unique name and iincrement the ID
            this.name = "Plorg" + id++;
            // assign the CI
            this.ci = ci;
         * Create a new Plebian.
         * Plebeians have a contentment index in [0, 24].
         * Each new Plebeian is welcomed with a contentment index of 2 and burdened
         * with a debt of $10.00. Plebeians never manage to break even, so they have
         * no taxes imposed upon them. Furthermore, since they can never get out debt,
         * they cannot accumulate any wealth.
         * @return a new Plebian.
        public static Plorg createPlebian()
            Plorg plebian;
            plebian = new Plorg(2);
            plebian.setDept(10);
            return plebian;
         * Create a new Equidian
         * Equidians have a contentment index in [25, 75].
         * Each new Equidian is welcomed with a contentment index of 50 and burdened
         * with taxes of $20.00. Equidians have taxes imposed upon them. Furthermore,
         * since they do manage to break even, they have no debt. However, since they
         * only manager to break even, they do not accumulate any wealth.
         * @return a new Equidian.
        public static Plorg createEquidian()
            Plorg equidian;
            equidian = new Plorg(50);
            equidian.setTaxes(20);
            return equidian;
         * Create a new Elitian.
         * Elitians have a contentment index in [76, 100].
         * Each new Elitian is welcomed with a contentment index of 87 and burdened
         * with taxes of $20.00, but also provided with a ?silver spoon? of $30.00 in
         * accumulated wealth. Elitians manage to expand upon their wealth, so they
         * have taxes imposed upon them. Furthermore, since they are accumulating
         * wealth, they have no debt.
         * @return a new Elitian.
        public static Plorg createElitian()
            Plorg equidian;
            equidian = new Plorg(87);
            equidian.setWealth(30);
            equidian.setTaxes(20);
            return equidian;
         * Returns this Plorgs name.
        public String getName()
            return name;
         * Returns the CI of this Plorg.
        public int getCI()
            return ci;
         * Set the new Contentment index for this Plorg
         * @param ci
        public void setCI(int ci)
            this.ci = ci;
         * Returns the Dept of this Plorg
         * @return
        public double getDept()
            return dept;
         * Set the dept of this Plorg.
         * @param dept - the new dept for the Plorg.
        public void setDept(double dept)
            this.dept = dept;
         * Returns the wealth of this Plorg.
        public double getWealth()
            return wealth;
         * Sets the wealth of this Plorg.
         * @param wealth - the new wealth of this Plorg.
        public void setWealth(double wealth)
            this.wealth = wealth;
         * Returns the taxes of this Plorg.
        public double getTaxes()
            return taxes;
         * Set the taxes of this Plorg.
         * @param taxes - the new taxes for this Plorg.
        public void setTaxes(double taxes)
            this.taxes = taxes;
         * Check for equality. If the object specified is a Plorg with the same name as this
         * Plorg they are deemed to be equal.
         * @param o - The object to check
        public boolean equals(Object o)
            if ( this == o ) return true;
            if ( !(o instanceof Plorg) ) return false;
            final Plorg plorg = (Plorg) o;
            if ( name != null ? !name.equals(plorg.name) : plorg.name != null ) return false;
            return true;
         * Create a Hash Code for this Plorg
        public int hashCode()
            return (name != null ? name.hashCode() : 0);
}

Similar Messages

  • Please help on this program

    Dear Friends,
    With the help of this program I am trying to connect two instruments (One is CM110 monochromator of Spectral products and another one is from Keithley 2400 source meter) with the same programs. With the help of this program I am trying to increase the wavelength of the monochromator by say 10 nm and want to read the current at applied source meter voltage. 
    But the problem is each execution of while loop it is keeping ON/OFF the souce meter applied voltage . I want to keep the applied source meter voltage on through out the whole while loop and read the current, but I am not able to do so.
    Please help me. For your further information I am attaching the LabVIEW Program.
    Thanks in anticipation
    Regards
    Upendra Pandey
    Attachments:
    p2_for_1.vi ‏25 KB

    Chemical,
    You may want to try initializing and closing the Keithley outside of the main loop.  Regards, -SS 

  • Please help me this program

    Please help me with this program,the progarm should operates as follows
    1)Calculate the number of words
    2)Calculate the number of sentences
    3)Calculate the repeated words
    * Title: <p>
    * Description: <p>
    * Copyright: Copyright (c) cds<p>
    * Company: s<p>
    * @author cds
    * @version 1.0
    package count;
    import java.awt.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import javax.swing.border.*;
    import java.util.StringTokenizer;
    public class Frame1 extends JFrame {
    JPanel jPanel1 = new JPanel();
    XYLayout xYLayout1 = new XYLayout();
    XYLayout xYLayout2 = new XYLayout();
    JScrollPane jScrollPane1 = new JScrollPane();
    JTextArea jta1 = new JTextArea();
    JScrollPane jScrollPane2 = new JScrollPane();
    JTextArea jta2 = new JTextArea();
    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JButton jbtCountSentances = new JButton();
    JButton jbtCountWords = new JButton();
    JButton jbtRWords = new JButton();
    JButton jbtClearList = new JButton();
    JTextField jtfNumOfSentances = new JTextField();
    JLabel jLabel3 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JTextField jtfNumOfWords = new JTextField();
    private JFileChooser jFileChooser = new JFileChooser();
    public static String sentence,RepeatedWords,repwords,chr=" ";
         public static int i,words,token,periods,characters,len,long_word,long_sent,stop;
    //Construct the frame
    public Frame1() {
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    }setSize(600,400);
    show();
    public static void main(String[] args) {
    Frame1 frame1 = new Frame1();
    private void jbInit() throws Exception {
    jPanel1.setLayout(xYLayout1);
    this.getContentPane().setLayout(xYLayout2);
    jLabel1.setForeground(Color.blue);
    jLabel1.setText(" Type your Doc");
    jLabel2.setForeground(Color.blue);
    jLabel2.setText(" Reapeated Words");
    jbtCountSentances.setBackground(Color.white);
    jbtCountSentances.setForeground(Color.blue);
    jbtCountSentances.setText("Count Sentances");
    jbtCountSentances.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jbtCountSentances_actionPerformed(e);
    jbtCountWords.setBackground(Color.white);
    jbtCountWords.setForeground(Color.blue);
    jbtCountWords.setText("Count Words");
    jbtCountWords.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jbtCountWords_actionPerformed(e);
    jbtRWords.setBackground(Color.white);
    jbtRWords.setForeground(Color.blue);
    jbtRWords.setText("Reapeted Words");
    jbtRWords.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jbtRWords_actionPerformed(e);
    jbtClearList.setBackground(Color.white);
    jbtClearList.setForeground(Color.blue);
    jbtClearList.setText("Clear");
    jbtClearList.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jbtClearList_actionPerformed(e);
    jLabel3.setForeground(Color.blue);
    jLabel3.setText("NumOfSentances");
    jLabel4.setForeground(Color.blue);
    jLabel4.setText("NumOfWords");
    jPanel1.setBackground(SystemColor.activeCaption);
    jPanel1.setForeground(SystemColor.activeCaption);
    this.getContentPane().add(jPanel1, new XYConstraints(4, 4, 986, 469));
    jPanel1.add(jScrollPane1, new XYConstraints(5, 105, 289, 192));
    jScrollPane1.getViewport().add(jta1, null);
    jPanel1.add(jScrollPane2, new XYConstraints(309, 102, 256, 193));
    jScrollPane2.getViewport().add(jta2, null);
    jPanel1.add(jLabel1, new XYConstraints(21, 81, 240, 22));
    jPanel1.add(jLabel2, new XYConstraints(340, 78, 191, 20));
    jPanel1.add(jbtCountSentances, new XYConstraints(69, 309, 190, 30));
    jPanel1.add(jbtCountWords, new XYConstraints(69, 339, 190, 24));
    jPanel1.add(jbtClearList, new XYConstraints(262, 337, 173, 26));
    jPanel1.add(jbtRWords, new XYConstraints(262, 310, 174, 24));
    jPanel1.add(jLabel3, new XYConstraints(14, 37, 105, 20));
    jPanel1.add(jtfNumOfSentances, new XYConstraints(114, 37, 64, 23));
    jPanel1.add(jLabel4, new XYConstraints(212, 38, 82, 23));
    jPanel1.add(jtfNumOfWords, new XYConstraints(304, 35, 83, 27));
    void jbtCountSentances_actionPerformed(ActionEvent e) {
    BufferedReader stdin = new BufferedReader
                   (new InputStreamReader (System.in));
    sentence = jta1.getText();
              System.out.flush ();
              len=sentence.length();
    jtfNumOfSentances.setText(String.valueOf(num_periods()));
    public static int num_periods () {
              i=0;
              periods=3;
              chr= ".";
    chr= "!";
    chr= "?";
              while (i<len){
                   if (sentence.charAt(i)==chr.charAt(0))
                        periods++;
                   i++;
         return periods;
         }//Method num_words
    void jbtCountWords_actionPerformed(ActionEvent e) {
    String s = jta1.getText();
    StringTokenizer st = new StringTokenizer(s);
    jtfNumOfWords.setText(String.valueOf(st.countTokens()));
    void jbtRWords_actionPerformed(ActionEvent e) {
    repwords = jta1.getText();
    StringTokenizer st = new StringTokenizer(repwords);
              while (st.hasMoreTokens())
    RepeatedWords = st.nextToken(st.toString()) ;
         jta2.append(RepeatedWords);
         //}//Method num_words
    /*void jbtClearList_actionPerformed(ActionEvent e) {
    jta2.setText(null);
    void jbtHelp_actionPerformed(ActionEvent e) {
    jta1.append("Please open a File Write a document");
    // JScrollPane jScrollPane1 = new JScrollPane();
    //JTextArea jta1 = new JTextArea();
    // JScrollPane jScrollPane2 = new JScrollPane();
    //JTextArea jta2 = new JTextArea();
    void jbtClearList_actionPerformed(ActionEvent e) {
    jta2.setText(null);
    jta1.setText(null);
    jtfNumOfWords.setText(null);
    jtfNumOfSentances.setText(null);

    Let me try specify the main problem in details
    The code that i had posted displays an interface consisting of a 2 textarea.
    The first textarea is for a user to enter a sentence and the second is for displaying duplicated words.
    The program should allow the user to enter a sentence on the first textarea and when JButton named showduplicatedwords pressed it must display the words that are being duplicated in the sentence on the second textarea.And again count the number of sentence available when
    JButton countsentence is pressed

  • Please help find the program

    Please help find the program to block unwanted number, call and SMS, that not all block number ,but  the number on which you want to.

    Which part of "The 5310 is just a java phone that cannot support applications like this." did you not understand?
    If you want to achieve any form of blocking at all, it won't be with that phone. Your operator may be able to help by putting a block in place on their end, though, but I doubt it.
    Was this post helpful? If so, please click on the white "Kudos!" star below. Thank you!

  • Search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.

    search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.I have writen code on EH_ONSEARCH .as per below...what changess i need to do..and through partner function and adding the selection params please send the sample .
    code. partner funtction - ZRG DATA :
    DATA : lv_partner_fct type .
    types: begin of ty_resp,
           partner    type but000-partner,
           name_last  type but000-name_last,
           name_first type but000-name_first,
           mc_name1   type but000-mc_name1,
           mc_name2   type but000-mc_name2,
           end of ty_resp.
    DATA: lv_resp_bp type STANDARD TABLE OF ty_resp INITIAL SIZE 0,
           lw_resp_bp type ty_resp.
    IF lv_attr_name = 'Rgroup'.
    lr_entity->get_property_as_value( EXPORTING iv_attr_name = if_crm_srqm_uiu_const=>gc_attr_low
                                       IMPORTING ev_result = lv_low ).
    IF lv_low IS INITIAL.
    SELECT partner
           name_last
           name_first
           mc_name1
          mc_name2
    FROM but000 INTO table lv_resp_bp
    WHERE mc_name2 = lv_low and bu_group = '0010'.
    loop at lv_resp_bp into lw_resp_bp.
        lv_low = lw_resp_bp-mc_name2.
      lr_query_service2->add_selection_param( iv_attr_name = 'Rgroup'
                                                iv_sign = lv_sign
                                                iv_option = lv_option
                                                iv_low = lv_low
                                                iv_high = lv_high ).
      ENDLOOP.
    if lv_partner_fct = 'ZRG'.
      lr_entity = lr_iterator->get_next( ).
    CONTINUE.
    ENDIF.
    lv_attr_name = 'BU_PARTNER'.
    ENDIF.

    <b>You can acheive   this .... first by creating the search help exit    ... by  creating the maintaince  view   then   using it in the   Creation of the search help </b> ...
    see the link for attaching the view   to the serach help .
    <a href="http://">http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_elementary.htm</a>
    reward  points if it is usefull...
    Girish

  • When trying to verify the email address, I get the following message. Please help. This email address is already in use or you may already have an Apple ID associated with this email address. Please try again or sign in using your existing Apple ID.

    When trying to verify the email address, I get the following message. Please help. This email address is already in use or you may already have an Apple ID associated with this email address. Please try again or sign in using your existing Apple ID.

    Me too. I try to verify and i get the same message.
    I've created 3 alternate e-mail addresses and tried creating new accounts.
    Same Result!
    This is bullsh!t. How the **** can all 4 of my attempts result in the same freakin error???

  • I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    So just to be clear, when you say "just bought" how long ago was that? Is it on this new iPhone that you had pictures, texts, etc that you want? Were you backing up to iCloud or onto iTunes?
    This may not help for everything but if you go to iCloud.com and log in, are you able to find your pictures there?

  • Every time I sync my Iphone 5c(with ios 8) to Itunes, it 1. deletes all of my purchased music 2. deletes all of my album artwork 3. replaces all of my deleted songs. please help! this is driving me crazy!

    Every time I sync my Iphone 5c(with ios 8) to Itunes, it 1. deletes all of my purchased music 2. deletes all of my album artwork 3. replaces all of my deleted songs. please help! this is driving me crazy! It syncs 100+ songs, when I only want to sync 1! I'm running Itunes 11.3.1.2

    After having experienced similar problems and having it back to work, I have a few suggestions:
    - Try to find out if the syncing stops at a particular track or song. That might - out of the blue - have gotten corrupted in one way or another. Since that song will not be on the iPod, iTunes will try over and over to put it on and crash in one way or another;
    - reformat the iPod as described in the iTunes 9 crash-thread. It takes time (at first it seems to do nothing, but that is because the green bar is moving with very small steps);
    HTH

  • Please Help on this

    Hi Experts,
        I have schema which has to be implemented in SAP BI 7.0.Schema contains one Fact Table & three Dimension tables.It is snowflake schema.
    Assume Fact table as F & Dimension  tables as D1,D2,D3.The Schema is as follows.
    F---->D1--->D2---->D3
    Now i have created navigation attribute from D1 to D2 & D2 to D3 Then i have created a infocube having  facts & D1 attribute.
    So when i drag the infoObject from D1 having navigation attributes to D2 & from D2 to D3 iam unable to get D3 information.
    Please can any one suggest me how to get D3 level of information in report Or how to accesss the facts & D3 level information .
    Please Help on this
    Thanks & Regards
    Sameer Khan

    Hi Sameer,
    Your question is not clear.
    Regards,
    Sagar

  • I was trying to set Adobe Reader 11 as default PDF viewer on my client PCs, Please help me this. My server is windows 2012 R2 and client PCs are Windows 8.1

    I was trying to set Adobe Reader 11 as default PDF viewer on my client PCs, Please help me this. My server is windows 2012 R2 and client PCs are Windows 8.1

    Hi Krisis,
    I have found a forum where similar query was answered. Hope this helps.
    http://www.loginvsi.com/forum/support-v4/857-adobe-reader-xi-not-set-as-default-pdf-viewer -in-server-2012-r2-rds
    Regards,
    Anoop

  • HT5312 i forgot my secret question, please help me this problem. Thanks

    I forgot my secret question, please help me this problem. Thanks

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact
    And/or see the  More Like This  section on the right.

  • Trying to update photoshop and repeatedly get error code U44M1P7, can anyone please help resolve this?

    Trying to update photoshop and repeatedly get error code U44M1P7, can you please help resolve this?

    JJMack, Thanks for the info. Let this old man digest it and see if I can put the info into action. I'll give you a feedback. Thanks for your help in this matter. I am not a tech savvy person. 
    Rueben Rueben D. Olivas Home Ph:  1-671-969-2452
    Cell Ph:  1-671-747-2453La Luz Photography
    Email: [email protected]/Guam Firehouse Cook: http://guamfirehousecook.blogspot.com/BBQGuam: http://bbqguam.blogspot.com/My Photostream: http://ruebenolivas.megashot.net/photostream

  • Please help in this

    Hi
    Please help with this:
    How to know if string buffer doent contain anything:
    I am getting stringoutofbounds exception..
    StringBuffer myString=new StringBuffer(" ");
    if(myString.toString()!=" ")
         int i=myString.lastIndexOf(",");
         myString.deleteCharAt(i).toString());
         }

    If you want to compare the equivalence of two String datatypes, use the "equals()" method. The technique you are using, the equality operator '!=', will compare not the semantic value of the string representation, but rather the value of the object reference of that string. So in your example, ( myString.toString() != "" ) will always be true, even if the StringBuffer is instantiated with an empty string because the two sides of the operator refer to different objects.
    Use instead ..
    if ( !myString.toString().equals(""))

  • My Canon MP620 appears to be connected, yet every time I try to print something, it says error.  I have tried to unplug and track the error, but I cannot figure out why. Please help! this is such an inconvenience!

    My Canon MP620 appears to be connected, yet every time I try to print something, it says error.  I have tried to unplug and track the error, but I cannot figure out why. Please help! this is such an inconvenience!

    What Mac model? What Mac OS version?
    FYI, this forum is for Apple hardware made before 1999.

  • Hi. i updated my iphone 4s to iOS 7.0.4 but after that, wifi is not enabled. please help in this regard.

    Hi. i updated my iphone 4s to iOS 7.0.4 but after that, wifi is not enabled. please help in this regard.

    Apple has provided a useless workaround... [http://support.apple.com/kb/ts1559]
    Else the only option you have is to fight with the Apple Store "geniuses" to get a free replacement for out of warranty 4S devices. Or try a third party repair like iFixit. The wifi chip might cost you 60-80$ but it is better than paying Apple 200$.
    Overheating is the culprit in 4S devices. And its been getting worse with ever successive iOS 7 update. I think 7.0.4 was the final nail in the coffin.
    They are not getting my money anymore.. I've had iPhones every since they launched... but no more. Feels like a dead investment after facing this issue. I can never sell my iPhone 4S even if I want to. There have been cases where users just sold their 4S devices, the new owner updated to 7.0.4, wifi stopped working and the seller had to give a refund.
    I'm basically sitting on a 650$ white brick. Hmm... I wonder if white bricks sell higher than the standard red bricks
    Guess it's time for you to sign up this ongoing campaign [https://www.change.org/petitions/apple-to-get-apple-to-replace-all-units-affecte d-negatively-by-the-update-of-ios7-or-patch-an-update-that-will-remedy-the-issue s-many-loyal-customers-are-experiencing#share]
    TBH, I can't get a replacement because I am in India where 4S was never launched as an unlocked device and there are no Apple retail stores. Only resellers here like Vodafone/Reliance/Airtel. But if this petition can help the one who can take advantage of having retail stores around... why not? Sign up please. Thank You.

  • My iPhone 4 is going auto off and auto on. Could you please help on this please

    my iPhone 4 is going auto off and auto on. Could you please help on this please

    iOS 8.1.3 is the latest version. There's nothing to download.

Maybe you are looking for

  • TS1713 The LED on the adapter connector doesn't light up when attached to the computer

    the led on the adapter connector doesn't light up when attached to the mac book pro and even not charging . I have 2 years warranty  so kindly resolve my problem. and reply me soon as possible.  Thank you

  • Java install 1.4.2 gets stuck at 8% loaded

    Hi. System: windows ME; tried on 2 machines - Compaq Evo (desktop) and Thinkpad (notebook). Identical result with both. Downloaded file (BIG) last night. Message in install box says "Preparing J28DK 1.4.2 components for installation. Please wait. Hou

  • Text animations in iwork '08

    Hi, I'd like to know how to do to make a text appear/disappear by clicking on the slide... I've to use the animation tool? How? It seems that I can use it only with images.

  • Boot erors

    Hi, Any idea what this errors are? 1. May 19 22:40:52 Leny kernel: ata1.00: failed to enable AA (error_mask=0x1) May 19 22:40:52 Leny kernel: usb 1-1: new high-speed USB device number 2 using ehci-pci May 19 22:40:52 Leny kernel: ata1: SATA link up 3

  • Getting songs from one computer to another

    I bought an album a few weeks ago (first time) and I just bought a new laptop. How can I get these files from my old computer to my new one? I thought if I make the new computer authorized, I would have access to these files, but cannot. Please help.