Need help on java school project :-/

Hi guys. I am currently taking a java class and am having particular trouble with a project that is due today. It is pretty simple but I am very new to java and keep getting errors when compliling that I do not know how to correct. Also, I am unsure as how I can incorporate the charAt() into the code (I am not even sure exactly what it is supposed to do; not very clear in the book)The background of my project is here:
http://www.cuyamaca.net/celder/CIS%20182/project/project_ii.htm
I hope someone can point out my mistakes and how to correct them if at all possible. Thanks a bunch. My code thus far is as follows:
//Project II
//Brian Schaefer
//CIS 182
//9-25-01
import javax.swing.*;
public class Project2 {
public static void main ( String args[] )
String firstName, lastName; // first and last name of user
char emptype; // type of Employee (i.e. Student, Hourly, or Salaried)
double hours, // hours person worked
earned, // how much was made before taxes
aftertax, // how much was made after taxes
overtime, // extra work, counted as 1.5x normal pay per hour
hourRate, // how much money per hour persons make
yearlySalary; // salaried worker's yearly pay
// Users enter their type of work
emptype = JOptionPane.showInputDialog ( " Enter Employee Type: H for hourly, T for Temporary Student, or S for Salaried ");
// User's first and last name are inputed
firstName = JOptionPane.showInputDialog( "Enter your first name" );
lastName = JOptionPane.showInputDialog( "Enter your last name" );
// if employment type is salaried, then the following commands are carried out
if ( emptype == S)
yearlySalary = JOptionPane.showInputDialog ( "Enter your yearly salary" ); // user enters their yearly pay
yearlySalary = (yearlySalary/52); // salary per week is calculated
aftertax = earned * .82; // money per week after tax (18%)
JOptionPane.showMessageDialog( "The gross weekly pay for " + firstName+ " " + lastName + " is" + earned +
"\n" + "The weekly pay after taxes is " + aftertax); // outputs gross pay, persons name, and their pay after taxes
// if employment type is hourly, then the following commands are carried out
if (emptype == H)
hours = JOptionPane.showInputDialog( " Enter hours worked this week " ); // user enters hours worked this week
hourRate = JOptionPane.showInputDialog( " Enter hourly rate " ); // user enters their wage per hour
// takes into account overtime
if ( hours > 35)
overtime = hours - 35; // hours over is subtracted from the standard week of 35 hours and stored
earned = (overtime * hourRate * 1.5) + earned; // number is recalled, then multiplied by rate, then by 1.5
//due to overtime paying out 50% more per hour and is then added to the non-overtime pay
aftertax = earned * .82; // takes into account tax of 18%
JOptionPane.showMessageDialog( "The gross weekly pay for " + firstName+ " " + lastName + " is" + earned +
"\n" + "The weekly pay after taxes is " + aftertax); // outputs user name, gross pay, and pay after taxes
else // if user does not work overtime then we go on the standard pay scheme
earned = hours * hourRate; // hours worked multiplies by hourly wage to get the gross earning
aftertax = earned * .18; // tax is taken into effect
JOptionPane.showMessageDialog( "The gross weekly pay for " + firstName+ " " + lastName + " is" + earned +
"\n" + "The weekly pay after taxes is " + aftertax); // outputs user name, gross pay, and pay after taxes
else
if (emptype == T)
hours = JOptionPane.showInputDialog( " Enter hours worked this week " ); // user enters hours worked this week
hourRate = JOptionPane.showInputDialog( " Enter hourly rate " ); // user enters their wage per hour
// takes into account overtime
if ( hours > 35)
overtime = hours - 35; // hours over is subtracted from the standard week of 35 hours and stored
earned = (overtime * hourRate * 1.5) + earned; // number is recalled, then multiplied by rate, then by 1.5
//due to overtime paying out 50% more per hour and is then added to the non-overtime pay
JOptionPane.showMessageDialog( "The gross weekly pay for " + firstName+ " " + lastName + " is" + earned +
"\n" + "NO TAXES DEDUCTED" ); // outputs user name and their gross pay; no money taken for taxes
else // if user does not work overtime then we go on the standard pay scheme
earned = hours * hourRate; // hours worked multiplies by hourly wage to get the gross earning
JOptionPane.showMessageDialog( "The gross weekly pay for " + firstName+ " " + lastName + " is" + earned +
"\n" + "NO TAXES DEDUCTED" ); // outputs user name, gross pay, and pay after taxes
// if user does not enter a valid employee type, they are looped and asked again
while ( emptype != H | S | T)
emptype = JOptionPane.showInputDialog( "Enter Employee Type again: H for hourly, T for Temporary Student, or S for Salaried only" );

First, try indenting your code an extra tab or a coupla spaces at each opening curly brace and indenting it less at each closing curly brace. This will help you see where the braces aren't aligning.
Second, you have an else buried in your code in an inappropriate place, essentially
if (sometest) {do some stuff}
else {do some other stuff}
else {here is the invalid else}
Third, usually you want to make sure you've validated your input before you procede onto your calculations and output, so the while loop you have at the end probably belongs at the beginning, possibly with a variable for the 'again' string.
String againString;
while ( emptype != H | S | T) {
emptype = JOptionPane.showInputDialog( "Enter Employee Type"+again+": H for hourly, T for Temporary Student, or S for Salaried only" );
againString = " again";

Similar Messages

  • Need help for a school project

    I am new to Oracle/Sql and the last part of my project requires that I use a Stored Procedure to access info from an AUTHORS table. I have followed the guidelines in the assignment but for some reason the Stored procedure is not working. If someone could help I would REALLY appreciate it. Thanks.
    public void fillSet(string key)
    if (connect())
    cmd.CommandText = "SELECT TO_CHAR(SALES.ORD_DATE), SALES.QTY, SALES.TITLE_ID, TITLES.TITLE, TITLES. PRICE FROM SALES, TITLES WHERE SALES.TITLE_ID = TITLES.TITLE_ID AND SALES.STOR_ID = :key";
    parm = new OracleParameter("key", key);
    cmd.Parameters.Add(parm);
    reader = cmd.ExecuteReader();
    while (reader.Read())
    ORDER_DATE = (string)reader.GetString(0);
    QUANTITY = (int)reader.GetDecimal(1);
    TITLE_ID = (string)reader.GetString(2);
    TITLE = (string)reader.GetString(3);
    PRICE = (double)reader.GetDouble(4);
    TOTAL = QUANTITY * PRICE;
    AUTHORS = loadStoredProcedure(TITLE_ID);
    loadDataSet();
    reader.Dispose();
    cmd.Dispose();
    oracleConn.Close();
    return;
    else return;
    public string loadStoredProcedure(string match)
    string cmdStr2 = "ALLAUTHORSFORTITLE";
    op1 = new OracleParameter();
    op1.Direction = ParameterDirection.Input;
    op1.Value = (object)match;
    op2 = new OracleParameter();
    op2.Direction = ParameterDirection.Output;
    op2.Size = 100;
    cmd2 = new OracleCommand();
    cmd2.CommandText = cmdStr2;
    cmd2.Parameters.Add(op1);
    cmd2.Parameters.Add(op2);
    cmd2.CommandType = CommandType.StoredProcedure;
    int code = cmd2.ExecuteNonQuery();  //error here
    String buildit = (string)op2.Value;
    oracleConn.Close();
    return buildit;
    }

    Hi,
    In cases with the same problems do you have, it's recommended to post a break point before the call of the store procedure. And then test the store procedure with this values separately. If you do this you can find out where the problem is.
    Also, is best if you put the output of the console log to see what it's the problem.
    Regards,

  • I need help for a school project please help MEEEEEEEDX

    ok ladies and gents help me out i need some info on oracle solaris 11 and i havent been able to find it online. here is the stuff i need:
    1. Number of Clients Supported-
    2. Number of Processors Supported-
    3. Support for SMTP, HTTP, DNS, File & Print and Remote Administration-
    4. Support for Windows, Linux, UNIX & Appleclients-
    5. Back up capabilities-
    if you know anything about this stuff please help me out i would greatly appreciate it. and have a great turkey day everybody.XD

    No one will do your work for you, particularly if it is schoolwork.
    You would be cheating and whatever grade you might get would be false because it wouldn't be your work.
    Here is the link to Oracle's documentation page.
    From there you can get to the documentation for Solaris 11.
    http://www.oracle.com/technetwork/documentation/solaris-11-192991.html
    There is a lot of OS documentation there, so you had better start reading.
      It will take some time for you to eventually undertand it all.

  • 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.

  • Need help with Java MIDI and VST info

    I am currently a college student for programming and I know programming very well, but for this current task, I am completely stuck. This is not a school project or work, just a personal project I'm working on at the moment to learn more about Java.
    What I am trying to create is a VST (Virtual Studio Synthesizer) using Java for use in music programs such as FL Studio, Sonar, Ableton, and so on. I did alot of Googling and found the following program:
    [http://jvaptools.sourceforge.net/index.html]
    I got it working, but it's not quite what I am looking for (it's more like an on-site editor that you enter code into and then run it). I want to create a VST from scratch and learn what each thing means in the program. I've done some research on MIDI input and output and found the following in the Java documentation:
    [http://java.sun.com/javase/6/docs/api/javax/sound/midi/MidiDevice.html]
    I figured I'm on track of what I'm looking for, but the problem is that the Java documentation simply sucks. It has no examples of code, how the functions work, and how I'm suppose to use them.
    First off, I want to start with the extreme bare basics. Is it even possible to do a VST in JUST Java? I've seen and used examples of obtaining data from a MIDI file and playing it, but that's not what I'm trying to do. Second, how would I take MIDI data from a music program running the VST and enter the data into a text box? Once I'm able to do that, I should be able to work with the data to produce audio output.
    My program I am attempting to make is a guitar synthesizer that I can run in music programs as a VST. If anyone around here knows anything about MIDI and VST plugins, please, post some example code and help point me in the right direction to creating something. I'm not looking to use other people's programs or code, I want to make something myself from scratch but I don't know where to start!

    Programming guide
    [http://java.sun.com/j2se/1.5.0/docs/guide/sound/programmer_guide/contents.html]
    Examples...
    [http://www.jsresources.org/examples/]

  • Need help on Java in sound application

    A good day to everyone here,
    I need help on using Java.My project is mainly manipulating WAV sound files with Java. There is some problem.I hope you all can help me. I couldn't find much info about Java in sound manipulating,sample coding or something like that. I need to find the command to
    1) Find each sampling point value in a sound file.
    2) Find the number of sampling point and the average value of the all the sampling point.
    3) Record the sound file in a different bit rate format.
    I dont know how to go about it.I really hope you all can help me, or direct me to any resources that may help me. Your help is very much appreciated.
    Thank you very much....

    i found this coding in a website n i not very sure that i understand it.
    can anyone tell me if i can find the sample point value of a sound file with this coding (byte[] source is byte array of the sound file).
    thanks...for all the help
    public byte[] executeAmplitudeTransformationInternal(byte[]
    source)
    int[] sampleArray = getSampleArray(source);
    int[] newSampleArray = executeTransformation(sampleArray);
    //convert 16 bit samples back to 8 bit byte[]
    return getByteArray(newSampleArray);
    public int[] getSampleArray(byte[] eightBitByteArray) {
    //create an array 1/2 the size (since every 2
    //8bit samples makes 1 16bit sample)
    int[] toReturn = new int[eightBitByteArray.length];
    int index = 0;
    for (int t = 0; t < eightBitByteArray.length; t += 2) {
    //read the high bit
    int low = (int) eightBitByteArray[t];
    //read the low bit
    int high = (int) eightBitByteArray[t + 1];
    //bit shift the high bit 8 bits to the left and
    // "And" the low bit against 255 to drop any
    //sign extended data in the top 8 bits.
    //refer to the tutorial for more clarification
    toReturn[index] = (high << 8) (low & 0x00ff);
    index++;
    return toReturn;
    public byte[] getByteArray(int[] sampleArray) {
    //create a new byte[] twice as big as the sample array
    //because it takes two 8-bit bytes to represent one
    //16-bit sample
    byte[] toReturn = new byte[sampleArray.length * 2];
    int index = 0;
    for (int t = 0; t < sampleArray.length; t++) {
    int sample = sampleArray[t];
    //this places the low byte in the array.
    //the downcasting automatically lops off the high byte
    toReturn[index] = (byte) sample;
    index++;
    //this byte shifts the sample 8 bits to the right
    //this puts the old high byte in the position of the low byte.
    //this way the high byte remains after the downcasating from
    //an int to a byte
    toReturn[index] = (byte) (sample >> 8);
    index++;
    return toReturn;
    public int[] executeTransformation(int[] sampleArray) {
    //create a clone sample array
    int[] newSampleArray = new int[sampleArray.length];
    //apply algo to each sample
    for (int t = 0; t < sampleArray.length; t++) {
    int result = (int) (sampleArray[t] );
    //add the sample
    newSampleArray[t] = result;
    return newSampleArray;

  • Need help with java

    ok so i have a midterm and need help this question that is gonna be on the midterm. i dont know how to do it and its worth 16 marks!!!! here it is
    the UW Orchestra wants to produce a CD containing all the pieces of music
    from its upcoming concert. In order to do that, it needs to calculate the total length of time for the
    CD. In addition, the conductor wishes to know which piece of music has the longest duration.
    Sample output for the program.
    The Swan (3.88)
    The Bee (0.98)
    Claire de Lune (6.02)
    Liebesfreund (3.38)
    Ragtime (3.48)
    The total time for the CD is 18.74 minutes.
    The longest piece is Claire de Lune.
    Do not include the HTML that is required to embed the program into a Web page (that is, show
    only what you would write between <script> and </script> tags).
    [4 marks] In the following space, define a function, Print, that takes two parameters, Title and
    Length, and outputs a line of text such that Title appears in italics, followed by Length in
    parentheses. The function also returns the value of Length.
    For example, Print("My World",30) will output the line
    My World (30)
    and return the value 30.
    Put your JavaScript program for the remainder of this question in the space provided on the next
    two pages.
    [9 marks]. For each piece of music, your program should input the title of the piece and the
    duration (in minutes) for that piece, and it should output a line showing those values using the
    Print function just defined. After all pieces have been listed, the program should output the
    total length of time for the CD, adding in 0.25 minutes between each piece of music (which is
    needed on the CD to separate the pieces).
    [3 marks] The program should also output the name of the piece that has the longest playing
    time.
    Use reasonable variable names, indentation and good programming style. Documentation and
    comments are not required, but you may add them to explain any assumptions you might want to
    make. You need not check that the input is valid, and you may assume that no two pieces have the
    same duration.
    can anyone help me out! i would be indebt of ur kindness if u can help me out!

    This forum is for Java, not JavaScript. The two have nothing to do with each other.
    And anyway, this is your studying, so you should try to do it, put forth your best effort, and ask specific questions (on the proper fourm).

  • Need help with Java Script to perform a calculation in Adobe Acrobat Pro 9 form

    I have a form (test) that I am creating in Adobe Acrobat Pro 9.
    I need help creating custom Java Script so I can get the desired answer.
    1) There are several questions in each group that require a numerical answer between 0-4
    2) There is a total field set up to sum the answers from all above questions
    3) The final "score" takes the answer from Step 2 above and divides by the total possible answer
    Any help on what Java Script I need to complete this would be greatly appreciated!
    I've attached a "spreadsheet" that shows it in more detail as well as what formulas I used in Excel to get the desired end result.
    Thanks in advance.

    Have you tried the "The field is the average of:"?

  • Help with Java programming project

    Hi,
    I need help in writing this Java program. The purpose of this program is to read a variable-length stream of 0, 1 characters from an input text file (call it input.txt) one character at a time, and generate the corresponding B8ZS output stream consisting of the +, - , and 0 characters (with appropriate substitutions) one-character-at-a-time into a text file (called output.txt).
    The program must use a class called AMIConverter with an object called AMI . Class AMIConverter must have a method called convert which converts an individual input character 0 or 1 into the appropriate character 0 or + or - of AMI.
    It first copy the line to file output.txt. Then read the line one character at a time and pass only valid characters (0 or 1) to AMI.convert, which assumes only valid characters. The first 1 in each new 'Example' should be converted to a +.
    This is what is read in, but this is just a test case.
    0101<1000
    1100a1000b00
    1201g101
    should now produce two lines of output for each 'Example', as shown below:
    This should be the output of the output.txt file
    Example 1
    in :0101<1000
    out:0+0-+000
    Example 2
    in :1100a1000b00
    out:+-00+00000
    Example 3
    in :1201g101
    out:+0-+0-
    To elaborate more, only 1 and 0 are passed to "convert" method. All others are ignored. 0 become 0 and 1 become either + or - and the first "1" in each new example should be a +.
    This is what I have so far. So far I am not able to get the "in" part, the characters (e.g. : 0101<1000 ) out to the output.txt file. I am only able to get the "out" part. And I also can't get it to display a + for the first "1" in each new examples.
    import java.io.*;
    public class AMIConverter
         public static void main (String [] args) throws IOException
              AMI ami = new AMI();
              try
                   int ch = ' ';
                   int lineNum = 1;
         int THE_CHAR_0 = '0';
         int THE_CHAR_1 = '1';
                   BufferedReader infile = new BufferedReader(new FileReader("input.txt"));
         PrintWriter outfile = new PrintWriter("output.txt");
         outfile.write("Example " + lineNum);//prints Example 1
         outfile.println();
         outfile.write("in :");
    outfile.println();
    outfile.write("out:");
         while ((ch = infile.read()) != -1)
         if (ch == '\r' || ch == '\n')
              lineNum++;
              outfile.println();
              outfile.println();
              outfile.write("Example " + lineNum);
              outfile.println();
              outfile.write("in :");
              outfile.println();
              outfile.write("out:");
         else
         if (ch == THE_CHAR_0)
              int output = ami.convert(ch);
              outfile.write(output);
         else     
         if (ch == THE_CHAR_1)
              int output = ami.convert(ch);
              outfile.write(output);          
    }//end while
         infile.close();
         outfile.close();
         }catch (IOException ex) {}
    }//main method
    }//class AMIConverter
    This is my AMI class
    import java.io.*;
    public class AMI
         int THE_CHAR_0 = '0';
    int THE_CHAR_1 = '1';
    int total = '+';
    int minus = '-';
    int count = 0;
    public int convert(int ch)
         try
              PrintWriter outfile = new PrintWriter("output.txt");
              if (ch == THE_CHAR_0)
         return ch;
         else
         if (ch == THE_CHAR_1)
         count++;
         if (count%2 == 1)
              ch = total;
              return (ch);
         else
                             ch = minus;     
                             return (ch);      
    }catch (FileNotFoundException e) {}      
         return ch;
    }//method convert
    }//class AMI
    Any help would be appreicated.
    Thanks!

    Hi,
    I need help in writing this Java program. The purpose of this program is to read a variable-length stream of 0, 1 characters from an input text file (call it input.txt) one character at a time, and generate the corresponding B8ZS output stream consisting of the +, - , and 0 characters (with appropriate substitutions) one-character-at-a-time into a text file (called output.txt).
    The program must use a class called AMIConverter with an object called AMI . Class AMIConverter must have a method called convert which converts an individual input character 0 or 1 into the appropriate character 0 or + or - of AMI.
    It first copy the line to file output.txt. Then read the line one character at a time and pass only valid characters (0 or 1) to AMI.convert, which assumes only valid characters. The first 1 in each new 'Example' should be converted to a +.
    This is what is read in, but this is just a test case.
    0101<1000
    1100a1000b00
    1201g101
    should now produce two lines of output for each 'Example', as shown below:
    This should be the output of the output.txt file
    Example 1
    in :0101<1000
    out:0+0-+000
    Example 2
    in :1100a1000b00
    out:+-00+00000
    Example 3
    in :1201g101
    out:+0-+0-
    To elaborate more, only 1 and 0 are passed to "convert" method. All others are ignored. 0 become 0 and 1 become either + or - and the first "1" in each new example should be a +.
    This is what I have so far. So far I am not able to get the "in" part, the characters (e.g. : 0101<1000 ) out to the output.txt file. I am only able to get the "out" part. And I also can't get it to display a + for the first "1" in each new examples.
    import java.io.*;
    public class AMIConverter
    public static void main (String [] args) throws IOException
    AMI ami = new AMI();
    try
    int ch = ' ';
    int lineNum = 1;
    int THE_CHAR_0 = '0';
    int THE_CHAR_1 = '1';
    BufferedReader infile = new BufferedReader(new FileReader("input.txt"));
    PrintWriter outfile = new PrintWriter("output.txt");
    outfile.write("Example " + lineNum);//prints Example 1
    outfile.println();
    outfile.write("in :");
    outfile.println();
    outfile.write("out:");
    while ((ch = infile.read()) != -1)
    if (ch == '\r' || ch == '\n')
    lineNum++;
    outfile.println();
    outfile.println();
    outfile.write("Example " + lineNum);
    outfile.println();
    outfile.write("in :");
    outfile.println();
    outfile.write("out:");
    else
    if (ch == THE_CHAR_0)
    int output = ami.convert(ch);
    outfile.write(output);
    else
    if (ch == THE_CHAR_1)
    int output = ami.convert(ch);
    outfile.write(output);
    }//end while
    infile.close();
    outfile.close();
    }catch (IOException ex) {}
    }//main method
    }//class AMIConverterThis is my AMI class
    import java.io.*;
    public class AMI
    int THE_CHAR_0 = '0';
    int THE_CHAR_1 = '1';
    int total = '+';
    int minus = '-';
    int count = 0;
    public int convert(int ch)
    try
    PrintWriter outfile = new PrintWriter("output.txt");
    if (ch == THE_CHAR_0)
    return ch;
    else
    if (ch == THE_CHAR_1)
    count++;
    if (count%2 == 1)
    ch = total;
    return (ch);
    else
    ch = minus;
    return (ch);
    }catch (FileNotFoundException e) {}
    return ch;
    }//method convert
    }//class AMIAny help would be appreicated.
    Thanks!

  • Need help in Java Script

    i Need some help in Java Script,
    am using the following code :
    <script type="text/javascript">
    var newwindow;
    function poptastic(url)
    newwindow=window.open(url,'name','height=300,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
    if (window.focus) {newwindow.focus()}
    else {newwindow.close()}
    //     if (window.focus) {newwindow.focus()}
    </script>
    In HTML,
    thWorld Environment
    Day, June 5<sup>th</sup>,2005
    Am using onmouseover event, so that when my mouse in on the link, popup is opened....and when my mouse is out of the link, the new window should b closed....
    but according to the above code, the new window is opened but have to close it manually....
    Is there any other way to close the popup when my mouse is out of the link

    Prawn,
    This is not really a good way to make friends. With the cross posting and the posting in a wrong forum anyway thing you have going.
    Please kindly take your question to an appropriate JavaScript forum.
    Have a happy day.
    Cross post from http://forum.java.sun.com/thread.jspa?messageID=3797201

  • Need Help Regarding JAVA BEAN

    Is any one tell me that JAVA BEAN only used in WEB or also you in Desktop applications???? and aslo tell how i implement Java class and use JAVA BEAN. I need help regarding above matter
    thanks in advance
    Rehan MIrza

    Here is a good link that indicate that JavaBean is not only for applets
    http://java.sun.com/docs/books/tutorial/javabeans/whatis/beanDefinition.html
    quote:
    The JavaBeans API makes it possible to write component software in the Java programming language. Components are self-contained, reusable software units that can be visually composed into composite components, applets, applications, and servlets using visual application builder tools. JavaBean components are known as Beans.
    Francois

  • Need help with Java always get error

    hey guys need help
    this the problem i get :
    I go to certain websites and I get this error with firefox.
    This Site requires that JavaScript be enabled.
    It is enabled.
    This is the one of the errors in java script console with firefox.
    Error: [Exception... "'Component does not have requested interface' when calling method: [nsIInterfaceRequestor::getInterface]" nsresult: "0x80004002 (NS_NOINTERFACE)" location: "<unknown>" data: no]
    I have installed the java script from there home site and did a test and says everything is fine. Any ideas?
    please help

    Hi 49ers,
    Sorry not to have any real idea of how to help you out here, but this is a Java forum, not JavaScript.
    Some Firefox expert may stumble across your post and be able to offer some advice (I hope they do) but this isn't really the best place to post such questions.
    Try here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3
    Good luck!
    Chris.

  • Need Help with Java Desktop CP Icon

    I just formatted and reinstalled Windows XP Home SP2 and installed the JRE 1.5.0.02. I usually see an icon in my Control Panel but it only appears in the Administrator's CP which I can reach in Safe Mode of course, but it would be easier to deal with if it appeared somewhere on my desktop/taskbar or CP (I am also an Admin). In Safe Mode I made sure that the right settings were made for displaying, but it doesn't.
    I know precious little about Java so I need help here.

    This forum is dedicated to Sun's Java Desktop System, an alternative desktop operating environment. Try reposting here:
    http://forum.java.sun.com/forum.jspa?forumID=54

  • Need help for java program

    Hi,
    I need help with my web application. When i tried to run it using
    localhost:8080
    it's giving me error that
    signup.do file is not available.
    can someone tell me what could be wrong with my code?
    I want to know what is .do file and what needs to do to have remove the error
    I have also used struts config file.
    Please help me.
    Message was edited by:
    star4588

    See struts documentation here http://struts.apache.org/1.2.9/userGuide/building_controller.html#action_mapping_example
    you should have something like that :
    <action-mappings>
            <action
                path="/signup"
                type="org.apache.struts.webapp.example.SignupAction"
                name="signupForm"
                scope="request"
                input="/signup.jsp"
                unknown="false"
                validate="true" />
        </action-mappings>in your struts-config.xml.
    Hope That Helps

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

Maybe you are looking for

  • Message processing in AII (from XI)

    Hi, we are in the process of connecting mySAP ERP ECC 5.0 with XI 3.0 and AII 2.1 but are running into some issues. 1. We are actually able to download a material with iDoc AIDMATMAS.MATMAS01 from mySAP ERP to XI. 2. We actually see in SXMB_MONI (in

  • ESS Workplace - Change Default Selection Period

    Hi All, We are on 4.6C, using Workplace 2.1.1 on ESS. Through ESS, we want to display all items under "SAP Office -> Outbox -> Started Workflows" (and also "Work Items Executed by Me"). The default seems to be 30days. Our SAP Office (Workplace) on ES

  • Select multiple pictures

    I want to select multiple pictures at once under photos Camera Roll.

  • HT201343 So a 2009 imac running snow leopard won't mirror on a new apple tv?

    Can not and late 2009 imac running snow leopard 10.6.8 mirror on a new apple tv?

  • Problem with new zen mi

    I just got a 6GB zen micro and it works fine. i put abunch of music onto it via creative mediasource organizer, but when i go to listen to the music on my micro i get an unsupported audio error, even though all of the music files on my computer are i