Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need this project for my semester using java pls and thanks Requirement 1: You

ID: 3768133 • Letter: I

Question

I need this project for my semester using java pls

and thanks

Requirement 1:
You are required to develop a robot navigation system that allows a robot to navigate safely and
successfully in an n*n chessboard. The value of n is determined at run time by the user. The starting
cell and the ending one are also determined by the end user. The chessboard may have some obstacles
scattered across it. You need to maintain a list (i.e. linked list) of those obstacles to avoid while moving.
The robot is not allowed to jump over an obstacle but allowed to backtrack if the path is blocked.
Backtracking means undo the last move and to try another possible move. Make sure that the number
of obstacles are reasonable given the check board dimension. You may end up stuck at a particular cell
since there are no feasible routes. You may wish to limit the maximum obstacles number to 25% of the
chessboard size. Your application should automatically move the Robot to reach the destination. The
robot is allowed to move only one step at a time in one of the four directions: Left, Right, Up and
Down.
The application should print:
1. The moves it took a robot to reach the destination
2. The number of moves until reaching the destination
3. All possible roots to the destination.
Requirement 2:
Allow two Robots to compete to reach a destination cell. The end user will be entering the positions of
those robot at the beginning along the destination cell and the program should compute the required
moves for each Robot to reach the destination cell.

Explanation / Answer

import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import java.awt.MouseInfo; import java.awt.Point; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; import javax.swing.JFrame; import javax.swing.JLabel; class InUI extends JFrame{ int wWin; int hWin; int xWin; int yWin; InUI(){ wWin=400; hWin=300; setSize(wWin,hWin); Point loc=MouseInfo.getPointerInfo().getLocation(); xWin=loc.x; yWin=loc.y; setLocation(xWin,yWin); addKeyListener(new KeyDetector()); addMouseMotionListener(new MouseMove()); setUndecorated(true); setOpacity(0.7f); Container cont=getContentPane(); cont.setLayout(new BorderLayout()); JLabel lbl=new JLabel("<html>Click and drag this capture area.<br>Press Enter to capture the screen.</html>"); lbl.setHorizontalAlignment(JLabel.CENTER); cont.add(lbl, BorderLayout.CENTER); setVisible(true); } class KeyDetector extends KeyAdapter{ public void keyPressed(KeyEvent e){ System.out.println(e.getKeyCode()); int code=e.getKeyCode(); if(code==27) //exit the program when the Esc key is pressed. System.exit(0); else if(code==45) //minimize the capture minimize(); else if(code==91) //decrease capture area decreaseSize(); else if(code==93) //increase capture area increaseSize(); else if(code==10){ //capture the screen when Enter key is pressed minimize(); capture(); } //else if((code==KeyEvent.VK_X) && (e.getModifiers() & KeyEvent.ALT_MASK)!=0 ) //System.exit(0); } } class MouseMove extends MouseMotionAdapter{ public void mouseDragged(MouseEvent e){ //change location of the capture area when mouse is dragged setWinLocation(e.getXOnScreen(),e.getYOnScreen()); } } public void increaseSize(){ Dimension ds=Toolkit.getDefaultToolkit().getScreenSize(); if(wWin<ds.getWidth()){ wWin+=5; this.setSize(wWin,hWin); } if(hWin<ds.getHeight()){ hWin+=5; this.setSize(wWin,hWin); } } public void decreaseSize(){ if(wWin>5){ wWin-=5; this.setSize(wWin,hWin); } if(hWin>5){ hWin-=5; this.setSize(wWin,hWin); } } public void setWinLocation(int x,int y){ xWin=x-wWin/2; yWin=y-wWin/2; this.setLocation(new Point(xWin,yWin)); } public void minimize(){ this.setExtendedState(JFrame.ICONIFIED); } public void capture(){ try { Robot rb=new Robot(); //capture the target part of the screen BufferedImage bi=rb.createScreenCapture(new Rectangle(xWin,yWin,wWin,hWin)); //save the image ImageIO.write(bi, "png", new File(System.getProperty("user.dir")+File.separator+"image"+System.currentTimeMillis()+".png")); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } public class RobotDemo { public static void main(String[] args){ new InUI(); } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote