Thursday, June 5, 2008

Hey guys- when my contacts IM me- I don t always get the message. It started off with me getting them a couple of minutes late- now I m not getting them at all. The only time I get them is when I log out of Yahoo and when I log back in I find that I have a pile of offline messages to read.

I ve emailed Yahoo submitting a bug report twice- I ve got replies twice and neither solutions have helped. It just seems to have gotten worse.

I ve tried uninstalling and reinstalling- also done a complete uninstallation and complete reinstallation- changing the network connection- I have the latest version of Java- Ive deleted all cookies- temp internet files etc- Ive added Yahoo to my trusted sites list and Ive even rebooted my pc! The last one seems to be a typical solution and even that didn t work!

It s really driving me insane now. Anyone got any ideas?

Thanks much.

Write a program that computes to the nearest cent a chart on bank balance. The interest is calculated on a monthly bases and the interested is compounded monthly. Once the interest has been calculated for the month it is stored in a variable called “interest” to three decimal places. The new balance stores the result in a variable called newBalance. Prove that the new balance is stored to the nearest cent by outputting the result of the calculated interest for the month and the old balance and newBalance in chart form. Print the newBalance to three decimal places. Test the program using a variety of values for balance and interest rate.
The program will ask the user to enter an opening balance starting in January- and the interest rate for the month.
The output will be in chart form:
Title of some sort
Opening Balance is $2636.00
Interest Rate:9.226%
There are two months with two old balances- two interest amounts and two new balances.
whoa- my bad- i dont know how it ended up here but anyway- if you can answer...great.

I have one class which has a button with an action event. When the button is pressed- i want another GUI application to start. The button is:

JButton btnRegister = new JButton("REGISTER");
btnRegister.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

}
});

When the register button is pressed- i want this class to come up:

package layout;

import javax.swing.*;
import java.awt.*;

public class Register {


private static void createAndShowGUI() {

String[] labels = {"Name: "- "ID No: "- "Username: "- "Password: "};
int numPairs = labels.length;

JPanel pan = new JPanel(new SpringLayout());
for (int i = 0; i < numPairs; i++) {
JLabel lab = new JLabel(labels[i]- JLabel.TRAILING);
pan.add(lab);
JTextField textField = new JTextField(10);
lab.setLabelFor(textField);
pan.add(textField);
}

SpringUtilities.makeCompactGrid(pan- numPairs- 2- 6- 6- 6- 6); //(rows- columns- initx- inity- xpad- ypad

JFrame frame = new JFrame("Nerkesa Pignatelli");
frame.setDefaultCloseOperation(JFrame...

pan.setOpaque(true);
frame.setContentPane(pan);

//Display the window.
frame.pack();
frame.setVisible(true);
}


public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(n... Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}

Normally i would just take whats in the main and put it in my action event in my other class- but i got this example from the sun website and they have createAndShowGUI(); in the main rather than somthing i normally have like new Title().setVisible(true); So i am unsure how to do it in this situation.

I am given an array which contains the integers 1 through 1-000-000 (one million). One integer in this array is repeated.
How can I write a function in Java that will find this integer and return it?

Any hints or suggestions are appreciated.

Assume method0 calls method1 and method2- method1 calls method 3. explain the chain of method calls (what order methods are called and from which method)

No comments: