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
:)
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
:)