How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Scott Your Own Question
Scott
Scott, MIT Graduate
Category: Homework
Satisfied Customers: 3040
Experience:  MIT Graduate (Math, Programming, Science, and Music)
3546829
Type Your Homework Question Here...
Scott is online now
A new question is answered every 9 seconds

Question 1. 1. (TCOs 1–8) Write a class called pointfor the

Customer Question

Question 1. 1. (TCOs 1–8) Write a class called point
for the 2-D environment with attributes for the x and y coordinates.
Select appropriate variable(s).
Write constructors.
Write access methods for the variables.
Write a Print method to display the variables when called.
Write a test program to test it. (Points : 20)
Question 2. 2. (TCOs 1–8) Write a class called circle,
which inheres the above point class. It is represented by a point which is the center of the circle and the radius.
Select appropriate variable(s).
Write constructors.
Write access methods for the variables.
Override the inherited Print method to display variable in circle and point.
Write a test program to test it. (Points : 20)
Question 3. 3. (TCOs 1–8) Start from the following code, and add Action Listener to make it functional to do the temperature conversion in the direction of the arrow that is clicked. (Need about 10 lines)
Note:
import javax.swing.*;
import
java.awt.GridLayout;
import
java.awt.event.*;
import
java.text.DecimalFormat;
public class temperatureConverter extends JFrame {
public static void
main(String[] args) {
JFrame frame = new temperatureConverter();
frame.setTitle("Temp");
frame.setSize(200, 100);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
public
temperatureConverter() {
JLabel lblC = new
JLabel("C",SwingConstants.CENTER);
JLabel lblF = new
JLabel("F",SwingConstants.CENTER);
final
JTextField jtfC = new JTextField();
final
JTextField jtfF = new JTextField();
JButton jbtLeft = new JButton("");
JPanel panel = new JPanel(new GridLayout(2, 3));
panel.add(lblC);
panel.add(jbtLeft);
panel.add(lblF);
panel.add(jtfC);
panel.add(jbtRight);
panel.add(jtfF);
this.add(panel); // Add panel to the frame
final
DecimalFormat dec = new DecimalFormat("#.00");
}
}
(Points : 20)
Question 4. 4. (TCOs 1–8) Start from the given class, and create a NewPanel class to draw a figure like below: (Need about a dozen lines)
import javax.swing.*;
import
java.awt.Graphics;
import java.awt.Color;
public class drawFlag extends
JFrame {
public
drawFlag() {
add(new
NewPanel());
}
public static void
main(String[] args) {
drawFlag frame = new drawFlag();
frame.setTitle("Flag");
frame.setSize(200, 200);
frame.setLocationRelativeTo(null); // Center the frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
The post tip is a solid circle coordinate and size is (68, 28, 4, 4).
The flag tip is a rectangle with coordinate and size is (70, 30, 50, 30).
The text coordinate is (85, 118).
The starting and ending coordinate for the post is (70, 30, 70, 120).
Color blue with text black. (Points : 20)
Submitted: 1 year ago.
Category: Homework
Customer: replied 1 year ago.
java logic pro
Expert:  LogicPro replied 1 year ago.
HIWelcomeWhat is the deadline?
Expert:  LogicPro replied 1 year ago.
What is the deadline?
Expert:  LogicPro replied 1 year ago.
Do you still need this answer?

Related Homework Questions