Click to See Complete Forum and Search --> : help with 2 java progs


chevanater
02-27-2004, 02:34 AM
Hello I need help doing an assignment for my java class. I can paypal you some money if you want, I just need to get this done.
Heres the 2 progs i have to do:
http://mcs.uwsuper.edu/sb/201/Exams/ex1.html

prog 1:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import javax.swing.*;
import java.awt.*;



public class Ex1_1
{
public static void main(String[] args) throws IOException
{
BufferedReader console =
new BufferedReader(new InputStreamReader(System.in));


}

public class changeTemp extends JApplet implements ActionListener
{
private JButton enterTemp;
private Container pane;
}
public void init()
{
pane = getContentPane();
pane.setLayout(new FlowLayout());

enterTemp = new JButton("enter temp in F");

pane.add(enterTemp);

enterTemp.addActionListener(this);

}
public void actionPerformed(ActionEvent e)
{
if (e.getSource() == enterTemp)

// String input;
input = JOptionPane.showInputDialog("Enter the temp in Fahrenheit, please");
int fahr = Integer.parseInt(input);
}


prog 2:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Ex1_2
{
public static void main(String[] args) throws IOException
{
BufferedReader console =
new BufferedReader(new InputStreamReader(System.in));

System.out.print("Please enter the time ");
String s = console.readLine();
int n = Integer.parseInt(s);
System.out.println("You entered " + n);



}

}


thanks for any help
:)

Kor
02-27-2004, 04:10 AM
Here's the javascript forum, not a java forum (java and javascript are quite different languages). Try in Java Forum. Ask moderator to move this thread there.

Khalid Ali
02-27-2004, 01:53 PM
Originally posted by Kor
Ask moderator to move this thread there.

Unfortunately we don't have a java forum on these forums...

may be

forums.java.sun.com

will work