.

Sunday, November 24, 2013

Tma02 255

M255 Object-oriented programming with Java Tutor-marked assignment 02 2011J [pic] Q1 i) /** * Moves the frog to the st integrity whose topographic point is prone one stone at * a duration and returns no value */ world void moveToPosition(int pos) { int currentPosition = proceedPosition(); //ignore if are already on the compulsory position if( pos != currentPosition) { //move one pace at a time left wing wing or right int step = 1; //move left is current position is after the pos to move if(currentPosition > pos) step = -1; int i=currentPosition; do //loop and move one position at a time until required position is met { i+=step; setPosition(i); } while(i != pos); // parallel until we are on required pos } //jump at a time jump(); } } Test. Image of RacingFrog rf = unused RacingFrog(); [pic] Image of rf.moveToPosition(7); [pic] Image of rf.
Ordercustompaper.com is a professional essay writing service at which you can buy essays on any topics and disciplines! All custom essays are written by professional writers!
moveToPosition(1); [pic] Q1 ii) a) unrestricted class Race { /* eccentric variables */ tete-a-tete boolean campaignOver; // indicates whether the race has been won private RacingFrog winner; // holds the winning travelFrog private haphazar d randomGenerator; private RacingFr! og racingFrog1; // holds the racing frog numbered 1 private RacingFrog racingFrog2; // holds the racing frog numbered 2 private RacingFrog racingFrog3; // holds the racing frog numbered 3 /** * detergent builder for objects of class Race. */ public Race(RacingFrog rf1, RacingFrog rf2, RacingFrog rf3) { super(); this.raceOver = true; this.randomGenerator = new Random(); this.racingFrog1 = rf1; this.racingFrog2 = rf2; this.racingFrog3 = rf3; } Q1 ii) b)...If you want to get a full essay, order it on our website: OrderCustomPaper.com

If you want to get a full essay, visit our page: write my paper

No comments:

Post a Comment