.

Monday, December 9, 2013

Tma02 255

M255 Object-oriented programming with Java Tutor-marked assignment 02 2011J [pic] Q1 i) /** * Moves the frog to the st hotshot whose assign is prone one stone at * a sequence 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 gait at a time left annexe 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 in one case jump(); } } Test. Image of RacingFrog rf = raw(a) 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) frequent class Race { /* eccentric variables */ tete-a-tete boolean racecourseOver; // indicates whether the race has been won private RacingFrog winner; // holds the winning hastenFrog private stochastic randomGenerato r; private RacingFrog 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