Question
Asked by:
sanjana86
sanjana86
Rating : No Rating
Questions Asked: 8
Tutorials Posted: 0
 

$35.00 Question based on java.

Q:
The question should be answered based on the programs given in the attachments.

The first attachment contains the question.

The 2,3 & 4th attachments are the programs on whose basis the question should be answered.
 
Attachments:
finalproj.doc (29K)
Train1.txt (0K)
Moving.java (6K)
Testframe.java (5K)


   
   
   
   
 
Available Tutorials to this Question
Posted by:
DoctorD
DoctorD
Rating (9): A-
Questions Asked: 0
Tutorials Posted: 28, earned $420.43
 

$35.00 Java threads program: hare vs tortoise

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Nov 24, 2008 at 11:51:57PM
A:
Preview: ... /panel for buttons<br> a1 = new Button("Start Race"); //set up for the buttons<br> q.add(a1);<br> contentPane.add(BorderLayout.SOUTH, q);<br> Handler handler = new Handler();<br> a1.addActionListener(handler);<br>} // end of constructor<br><br>class Display extends Canvas{<br><br> public void paint(Graphics g)<br> //EFFECTS: displays the graphics for the racer tracks and the racer as represented by a letter<br><br> {<br> g.setColor(Color.blue);<br> g.drawLine(0,200,500,200);<br> g.drawLine(0,215,500,215); //track a1<br> g.drawLine(0,315,500,315); //track b1<br> g.drawLine(0,300,500,300);<br> g.drawString("H", a1_x, a1_y);<br> g.drawString("T", a2_x, a2_y);<br> g.drawString(s_a1, 10,10);<br> g.drawString(s_a2, 10, 30);<br> }<br>}<br><br> public void move(int x, int y, int track)<br> //REQUIRES: x,y and track must not be null<br> //MODIFIES: this<br> //EFFECTS: changes the cooridinates of our racer to (x,y);<br><br> {<br> if(track == 1){<br> a1_x = x;<br> a1_y = y;<br> if (x >= 500)<br> {<br> ...

The full tutorial is about 1895 words long plus attachments.

Attachments:
Screenshot-Hare vs Tortoise Race.png (7K)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty