Extract: The Circle object defines the values of a given circle based on the radius value passed by the user. Radius can either be defined at object creation, or updated based on the setRadius() method. Values for the circle can be returned using the three getter methods: getRadius(), getDiameter(), and getArea(). Finally, all three attributes can be returned to the system console using the printCircle() method.
Procedural Programming versus Object oriented Programming
Extract: Procedural programming is a type of code writing whereby the programmer lays the code out in a step-by-step fashion. “Procedures – simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program’s execution, including by other procedures or itself” (Network Dictionary, 2007, p. 387). In essence, the programmer writes a bit of code and then references that code throughout the application. However, the code’s lifetime only exists within the scope of that application’s runtime.
Extract: The arraySorting class takes twelve inputs of type double from a user and stores them in an array. It then sorts that array from smallest to largest. After sorting, it outputs, in a formatted manner, the contents of the stored array. The user is then prompted to either end the application or continue another loop. This class implements both the arrayBubbleSort class and the Menu class (for which I described last week). Output for this class can be found in the index of this paper.
Extract: The primary reason to use an array is to create a logical order between the elements of that array. When moving to a multi-dimensional array, this logical order extends itself into a relational space. This is similar to how relational databases store data in tables, where each cell is related to corresponding cells based on their similar row, column, or cube location (Farrell, 2012, p. 388).
Extract: The Ex01 class takes a predefined ArrayList and requests that a user add to that list. It does this via the InputStreamReader object inside of a BufferedReader. The BufferedReader takes a given input stream and reads ahead a certain number of bytes. Once that number of bytes has been reached, it then returns the value via one of its read methods (Oracle, 2012). InputStreamReader takes a given byte set and converts it into a char set (Oracle, 2012). Using these two via System.in, input from a keyboard is converted to char values, which can then be converted to a String via the BufferedReader’s readLine() method.
Extract: The HTDemo class demonstrates the use of a hashtable object. First objects are inserted into the hashtable based on a String key. The values for each key represent the integer value of that key. A user is then asked for input to retrieve a value from the hashtable. If the input the user provides does not match a key in the hashtable, an error message is displayed. Otherwise, the value for that key is returned. At the end, the system prints out the hashtable’s contents in a formatted table.
Extract: Trees are, in essence, hierarchical data structures whereby the root node is located at the top, and leaf nodes are at the bottom (Sherrod, 2007, pp. 303-305). A great example of such a tree is the DNS naming system which is the backbone of the internet. Each URL contains the essence of hierarchical structures, for instance: www.waldenu.edu. The top end DNS server of “.” is the root of the URL hierarchy, edu is the first layer of the tree, waldenu is the second layer, and www is the leaf.
Extract: The primary difference between AWT and Swing is in the implementation of the code itself. AWT interfaces, in a large number of packages, with the native operating system that the code is run (Farrell, 2012, p. 644). This means that in some instances AWT can potentially run faster, and in the past, was true in most cases. However, with advancements in hardware, and improvement in code performance, this is not as obvious anymore.
In this assignment I was tasked with developing a fully functional application with a graphical user interface.
Extract: Clure Co. Pizzaria is a pizza ordering submission program. A user types in a customer’s name, chooses a pizza size, pizza type, any additional toppings they would like, and whether they are eating in or taking away. Once all required fields have been entered, the submit button becomes available. Upon clicking the submit button, the user is presented with the customer’s total, tax, subtotal, and name, a print receipt button becomes available at this time, as well. Clicking the print receipt button brings up the printing menu. After choosing the destination a basic receipt printout of the user’s transaction occurs.