Thursday, October 3, 2013

We start by creating an Application


Home Blog Videos Wiki Project Computer Classes dukes mascot Basic Computer JAVA NetBeans MySQL Object Oriented WordPress Interior Design Colors Autocad SketchUp Physics Mechanics Thermodynamics Kinematics Thermology Mathematics Arrays dukes mascot Enable Activity Groups Forums Register Share Shared Shares About About Search for:
To answer this you can click the link above and you will see the following definition on wikipedia:
Calculator is a device for performing dukes mascot numerical calculations. This type is considered distinct dukes mascot from calculating machines and computers, in the sense that the calculator is a device aimed at a specific purpose and can not be described as a Turing machine.
Note that on the whole we think there are many objects and many calculators. dukes mascot Enter into an agreement:
"The dukes mascot set of objects calculators call CLASS CALCULATOR. If it were a set of objects TVs call CLASS TV, and so on to any number of objects. ALWAYS BE SO. "
For the computer that will be set there will be a special program dukes mascot in case the object calculator that will add, multiply, subtract etc. To these TRANSACTIONS SHARES or combine to call them METHODS. OK? In this case, our object calculator displays the following methods: add, multiply, subtract etc.
Once you have made a transaction need to store the result somewhere. Thus, it would be interesting to us to do it inside. We will create a place within itself for this task. This site is a region of memory that will receive a name so it can be accessed when you need it. The name you give the result, ie, to perform an operation, to know the result simply login result.
This internal location, which is nothing more than a VARIABLE as will be seen ahead is a space set to a ATTRIBUTE or PROPERTY Calculator. The PROPERTIES calculator are only a representation of its characteristics and stored in local internal to it. Eg
Note that the student named in the object dukes mascot space name must have content as the student's name. For example, José Carlos. Already the space called property class will 2IK. And so on. Now learn more details about PROPERTY CLASS Attributes. About Object Orientation and Java, mainly dukes mascot for CONSULTATIONS dukes mascot see How to learn Java.
This is the class diagram that represents the class Calculator. The diagram it performs 4 operations: add, subtract, multiply, divide and mostrarResultado. These are class methods. Already result is a class property. number1 and number2 values are sent to the operations for which the calculations can be made.
For you to create Class diagrams, there is a tool that is easy to use Argo UML which can be downloaded dukes mascot here. And to install it and see how this can be done, see this book: ARGO UML or the video below:
Once created the calculator object, which is nothing more than a block schedule, the question is how we store it and use it. For this, we need a memory region (A box or VARIABLE) to which it is sent. This region will receive a name that will serve as an identifier access. The name given to it is called VARIABLE). See:
Note that the calculator with uppercase C will be adopted as the class name. Already dukes mascot tiny calculator with c as the variable name (could choose any name for these things, however, you find it easier to understand?). Identifiers and things are different, at least for the JAVA language.
See, also, that by setting a variable is required to reserve the right size of memory to store the object that will be sent to it. THIS NEEDS TO BE TOLD THE COMPUTER. We call this DEFINING THE TYPE OF VARIABLE.
Consider in our design notation calculadora.somar (number1, dukes mascot number2) will cause our calculator add the contents of the variable number1 to content notation variable number2. The same will happen with the other operations.
Note that calling the variable calculator is the same as calling the object inside the symbol "." Calls the execution of the operation belonging to him. So calculadora.somar (3.4) means "calculator add the numbers 3:04."
Well, let's start the project implementation. For this we will use NetBeans. To install it go to the Installation Instructions NetBeans. It is a software that creates an environment IDE ergonomic and efficient programming in JAVA. So, do the following:
Once seen features and functionality of the editor go Assistance Code in NetBeans IDE Java Editor: A Reference Guide and do some tests with assistance provided by the publisher for learning.
We start by creating an Application

No comments:

Post a Comment