Campbell Ritchie wrote:Your constructor is leaving the wizard controller object in an inconsistent state, with too few repeats. Use the same names for the parameters as you did for the fields if you are using the this.xxx = ...; idiom.
Your promptRepeats() method doesn't set the repeats.
Your getRepeats() method shouldn't prompt for corrections. Make your methods each do one thing and one thing only.
Have you been told to use that method for IO? There are better ways to read from the keyboard.
Jeanne Boyarsky wrote:I went to an in person university and it didn't prepare me for the OCA either. I don't college is designed to do that. Nor is a job. That's why study guides exist .
That said, when you interview for a job, interviewers will want to see internship experience or a project you did for fun. So signing up for a free github.com account and writing some code (ex: a game) gives you something to talk about at your interview besides school.
If others are struggling and you are doing well, it suggests you have an affinity for the topic. Which is good to have in a career . Learning more is still good though and will help set you apart.
Campbell Ritchie wrote:No, the cert exams test knowledge completely different from what you learn at University and also different from what you use on the job. Somebody like Liutauras or Tim C will know a lot more than me, but I think people get an entry level job and then work for a cert later, or more frequently, an MSc.
Jeanne Boyarsky wrote:. . . . I don't [think] college is designed to do that. Nor is a job. That's why study guides exist .
And let's have a “disclosure of interests” about how many cert exam guides you wroteSame on this side of the Pond. Many courses here are four‑year “thick” sandwich courses. That includes a year's internship . . . with a salary attached. The teaching staff visit every student on industrial placement to verify they are still there . . . and to verify that they are being given something wothwhile to do.
. . . internship experience or a project you did for fun.I hope you are right and not that the assignments are set too easy. If GK shows us some code, we can have a look at it and it should be easy to assess its quality.
. . . you have an affinity for the topic. . . ..
Open Univrsity is sort of “in person”. Although much of the teaching is delivered via
TVthe Net, students should meet a supervisor in person regularly and go away for intensive short courses. Maybe that interaction has been lost under CoViD; Universities have been very keen to minimise the risk of appearing on the front page of thee newspaper as, “983645837629856239846593874 CoViD cases at XYZ University”.
The WizardController class has the following private instance variables:
Two variables of type Wizard:
wizard1 and wizard2
which represent the wizards performing the moves;
A variable of type int:
which holds the number of times the moves are to be repeated;
It also has three int class constants:
MIN_NUM_REPEATS and MAX_NUM_REPEATS
which hold the minimum and maximum number of times the moves can be repeated.
which holds the maximum cell number permitted in the X direction.
The class has a single constructor that takes two arguments of type Wizard and assigns them to the two Wizard instance variables.
You are now going to write the various methods in WizardController that animate the wizards. In order to follow the motion of the wizards properly you will need to slow the animation down. To help you do this we have provided a class method delay() in the WizardController class.
e.g. If you want a delay of 100 ms you would insert the following statement at the appropriate point in your code.:
Remember to use delay() at the appropriate point in each of the methods you write to animate the wizards.'
You should remind yourself of methods the Wizard class provides now as you will need to use these in your code.
Remember that you cannot make use of the Wizard method getPersona() within the WizardController class.
i.Write a public class method jump() that returns nothing. It should make the wizard passed as argument jump up one cell position from its current cell then return to its original cell.
Now create an instance of wizard and execute the jump() method passing it as argument to check this works as expected. You'll find code in the README file that will help you with this.
ii.Next you are going to create a public class method travel() that takes a single argument of type Wizard and returns no value.
The wizard should move left or right as appropriate one cell at a time.
If the wizard's cellX value is currently LAST_CELL it should move so that its cellX value is 0.
Otherwise it should move so that its value is LAST_CELL.
Test your code to make sure the wizard behaves as expected.
iii.Add an additional boolean argument isMagic to your travel() method, that governs whether the wizard moves straight to its destination or cell by cell in a loop.
Amend the code body of travel() so that for each path, if the argument isMagic is true then the wizard moves straight to its final destination so that cellX is 0 or LAST_CELL as before.
Otherwise the wizard should move as in part (b)(ii).
Test your code to make sure the altered behaviour of the wizard is as expected.
iv.Write a public class method switchTrack() that takes two arguments of type Wizard and returns no value. The method should switch the cellY values of the two wizards.
Campbell Ritchie wrote:Welcome to the Ranch
Where are you reading this course? How do you manage to get 95%? In most BSc courses, 60%+ counts as a “good” mark (≡2i). I would expect a computer sciences course to include algorithms and data structures, principles of computing, logic, databases, etc., as well as simple language work.