![]() ![]() Robot's name is the same as its serial number and it was not made by The serial number (> 0) of this robot, the month and year of construction,Īnd size: 'L' (large) or 'S' (small). Robot( int serialNum, int month, int year, char size)Ĭonstructor: a new Robot. The descriptions, while informal, are complete. Pay close attention to the parameters and return values of each method. Robot MethodsĬlass Robot has the following methods. ![]() Whenever you write a method (see below), look through the class invariantĪnd convince yourself that class invariant is correct when the method terminates. The classĭescribes all legal values for the fields together. On these fields is called the class invariant. In a comment that the field represents the size of a robot, For example, on the declaration of the field size, state Known or if this robot was not built by other robots.Īccompanying the declarations of these fields shouldīe comments that describe what each field means –what The maker is the name of a Robot object (manilaįolder) that built this robot.Assume all tags givenĪre unique do not write code to check whether a robot with The serial number will be a unique identifier for each Robot.The year of construction is something like 1997 or 2012.ĭo not worry about invalid dates do not write code that checks whether dates are valid: assume they are valid. The month of construction is in the range 1.12, representing a month from.If a robot has not been assigned a name, its name May have the same name just as two people may Here are some details about these fields. This is the same as the serial number, but a String instead name (a String, if not specified otherwise.number of robots built by this one (an int).The tab of folder of the Robot object that Here are the fields, all of which should be private (you can choose the names of these fields). It has several fields that one might use to describe a robot, as well as methods that operate on these fields. Class RobotĪn instance of class Robot represents a single robot. If you don't know where to start, if you don't understand testing, if youĪre lost, SEE SOMEONE IMMEDIATELY -the course instructor,Ī TA, a consultant. Follow the instructions givenīelow in order to complete the assignment as quickly and as efficiently as ThisĪssignment will help illustrate how Java’s classes and objects canīe used to maintain data about a collection of things -like robots. Which will maintain information about robots capable of building other In this assignment is to develop a Java class Robot, It is not hard to imagine that one day robots will build robots. Today, robots build many of the things we use every day, from the chips in this computer, to the car Dr. To build copies of themselves in a 2005 project ( , Cornell's own Hod Lipson proved that it was possible for robots However, self-replicating robots are not solely in the domain of scienceįiction. We get the word "robot" itself (see the OED). by Czech playwright Karel Čapek, from which Self-replicating robots titled Autofac in 1955. Have been thinking about the idea of self-replicating robots for a very Monitoring Self Replicating Robots Introduction Assignment 1 (Robots) Submit on the CMS two weeks into the course
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |