Rabu, 18 Januari 2012

Chapter 2

                                                           Literature Review

2.1 Combination
In this project, there are a lot of food ingredients. Therefore, there are a lot of food ingredients possibilities. Each total ingredients the user has, have its own possibilities. The number of possibilities can be counted with combination theory. Combination is an arrangement of elements of a set and order doesn’t matter. The number of r-combinations of a set with n elements, where n is non-negative and 0≤r≤n is :
In the prototype, there are four ingredients. If user only has one ingredient, there are four possibilities.
If user has two ingredients, there are six possibilities.
If user has three ingredients, there are four possibilities.
If user has four ingredients, there is one possibility.

2.2 Object-Oriented Programming (OOP) in Java
Languages like Java are object oriented. Programming in such a language is called Object-Oriented Programming (OOP), and it allows computer programmers to implement an object-oriented design as a working system. In Java, the unit of programming is the class from which objects are eventually instantiated (created). Java classes contain methods as well as fields (which implement attributes). Java programmers concentrate on creating classes. Each class contains fields and the set of methods that manipulate the fields and provide services to clients (other classes that use the class). The programmer uses existing classes as the building blocks for constructing new classes. Classes are to objects as blueprints are to houses. Java programmers can instantiate (create) many objects from one class. Classes can have relationships with other classes. For example, in an object-oriented design of a bank, the "bank teller" class needs to relate to the "customer" class, the "cash drawer" class, the "safe" class, and so on.
InoFood is developed under Java programming language. There are 3 classes in this program and each class has its own methods and attributes.
2.3 Multiple Selection Concept in Java
There are some conditions may occurred in some cases. Each condition can perform different action. Therefore, this program implement multiple selection concept in Java using else if statement. The else if
statement allows programmer to specify an action to perform when a condition is true and a different action when a different condition is true. In this program, there are some conditions may occurred depends on the ingredients combinations. Else if statement is sufficient to provide any form of selection clearly and efficiently.

Tidak ada komentar:

Posting Komentar

 
Gorgeous Beaches of Goa