This site requires JavaScript, please enable it in your browser!
Greenfoot back
sonali98
sonali98 wrote ...

2018/10/24

Need help with Marble Project

sonali98 sonali98

2018/10/24

#
I am currently working on a marble project where marbles are added to a ground and their y values for their coordinates are from 0 to 12 and the x values are randomly generated. I have to test and implement a getMarbleAtHeight() method and I am not sure where to start. How exactly are you supposed to test this method. /** * Finds the marble at the specified height (which could be * at any x-coordinate for that height). * @param yPosition The y-coordinate where the marble is located. * @return The marble with the specified y-coordinate. */ public Marble getMarbleAtHeight(int yPosition) { throw new UnsupportedOperationException( "You have not implemented getMarbleAtHeight() yet"); } right now it throws an exception because I have not implemented the method or ran any tests
danpost danpost

2018/10/24

#
Note that the method is declared to return a Marble object.
You need to login to post a reply.