Classes and Methods

  Classes and Methods

A java program may be used to calculate the area and perimeter of a rectangle. This is a case where a program inputs the width and length of a rectangle, computes, and then prints the area and perimeter. Wong & Nguyen (2008), note that objects are entities used to represent a particular piece of the system. For this problem, the rectangle object has two fields; width and length. Width field holds the rectangle width while length field holds the length of the rectangle (Wong & Nguyen 2008).

There are several nouns, which include width, length, rectangle, area, and perimeter, while verbs include input, set, compute, and print. In order to build a rectangle class, the methods that apply or the operations are set width, set length, get width, get length, compute perimeter, and compute area (Brglez & Stallmann 2005).

Regarding the local police department software, the program should show the police officer the different items within the software from which to search. The program should then let the officer selector track (Cahill, 2000) . In addition, this program should release data about the item. Therefore, this program needs a database class in which to store the data about people, property, and criminal. Moreover, the program needs a register class to identify the officer seeking the information through a password (Cahill, 2000).  Finally, the program requires tracking software class to instantiate the register objects and database class. The table below gives a summary of three classes with their data members and methods.

 

 

 

Class Tracking software Register Database
Data members and/or methods People, property, criminal, show selections, make selection Authentication, enter password Class, get class, set class

 

Table 1: summary of classes

References

Brglez, X. Li, M. Stallmann (2005). On classes and a method for reliable performance experiments with sat solvers. Annals of Mathematics and Artificial Intelligence, vol. 43, no. 1, pp. 1-34.

Cahill, V. (2000). Objects and classes in java. Retrieved from https://www.scss.tcd.ie/glenn.strong/CS1/2.02-FirstProgram.pdf

Wong, S., & Nguyen, D. (2008). Principles of object-oriented programming. Informally published manuscript, Rice University, , Houston, Texas.

Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.

[order_calculator]