Wednesday, March 30, 2011

How Much Do Pearl Earrings Sell For

Implementation Patterns (WORKSHOP)

Well enclose lines of code in which I believe are present Iterator design patterns and the Interpreter.

Iterator Pattern

 System.out.println ("Inventory list \\ n"); 
imprimir.list.iterator Iterator iter = () / / traverse the list of names of stored products and print
while (iter.hasNext ())
System.out.println ("Name:" + iter.next ());
imprimir.listid.iterator
Iterator iter = ();
while (itera.hasNext ()) / / through the list of ID's saved and printed
System.out.println ("ID:" + itera.next ());
iterac = imprimir.listcant.iterator
Iterator ();
while (iterac.hasNext ()) / / through the list of quantities of products stored and printed
System.out.println ("Available:" + iterac.next ());
iteration = imprimir.listprice
Iterator. iterator (); / / Down the list of prices for goods stored and printed
while (iteraci.hasNext ())
System.out.println ("Unit Price:" + iteraci.next ());}



Here} iterators touring show data structures to see if there is information stored and then print the information.

------------------------------------------------ --------------------------------------------------
-------------- Interpreter Pattern


 public class Product {public 



String name;
private int ID, Quantity; / / Named attributes to add products
private float price;

List
list = new ArrayList (); / / generate lists of data that we store
List list = new ArrayList (); / / List the inventory
listcant = new ArrayList ();
List listprice = new ArrayList ();
protected void

ingproducto () / / method which accede to enter
products
{Integer ID = new Integer ( 0), / / \u200b\u200bcreate an object to store integer data
Float Price = new Float (0); / / create a data object to store a floating
Scanner
read = new Scanner (System.in);

System.out.println ("Product Data Entry);
System . out.println ("============================="); / / menu of options for discharging a product
System.out.println ("Enter the Name->");
lectura.nextLine Name = () / / save the name
list.add (name) / / add to the list
System.out. println ("Enter Product ID->");
ID = lectura.nextInt () / / save the ID
listid.add (ID) / / add to the list
System.out.println ("Enter the number of products available->");
Quantity = reading . nextInt (); / / save the amount
listcant.add (Quantity) / / add to the list
System.out.println ("Enter the Product Price->");
lectura.nextFloat Price = (); / / keep the price
listprice.add (Price) / / add to the list



}}


Since only found in the java API declaration lists for String data types, create objects that would allow me to save and read data types integer and floating it as a specialized language, as originally stated was not the case.

Nintendo Club Reward Point Generator

Patterns (CLASS)

Hello, I comment on this entry design patterns, which I understood, contains or can be implemented in my project.

First of all define what a design pattern.

"A design pattern is a solution to a design problem. For a solution is considered an employer must possess certain characteristics. One of them is that there must be proven effective in solving similar problems past. Another is to be reusable, which means that it is applicable to different design problems in different circumstances. "


Now, in the next picture is my class diagram, point out what I consider design patterns can be seen in my classes .




identify patterns that can be or are used and the Interpreter Iterator .

Defined by Wikipedia:
--------------- -------------------------------------------------- -------------------------------------------------- ---------------

"The Iterator design pattern defines an interface that declares methods for sequentially accessing a set of objects in a collection. Some of the methods that can be defined in the Iterator interface are:
First (), Next (), Hayman () and ElementoActual ()

This design pattern allows to cover a data structure without having to know the internal structure the same.

in java eg
"An iterator is the resource for travel collections. The iterator always knows where the next element. Some of you know where the previous item. I mean, who can recognize the library in both directions." -------------------------------------------------
-------------------------------------------------- -------------------------------

The Interpreter design pattern , is used to define a language for representing regular expressions that represent strings to look into other chains. Moreover, in general, to define a language to represent the different instances of a family of problems.

------------------------------------------------ -------------------------------------------------- --------------------------------


considered now explain why these patterns:

First,
Iterator Pattern
, because the products are stored in lists, for printing is to use an iterator that loops through las listas buscando información alojada y si la encuentra, la imprime a la pantalla.

El patrón Interpreter , es debido a que tuve que crear objetos que me reconocieran los tipos de datos enteros y flotantes y poder generar las listas de productos, y así pueda guardar e imprimir cadenas de datos.

Cualquier comentario o corrección es bien recibida, honestamente no le entendí muy bien a este tema.

Saludos

Thursday, March 24, 2011

Filmes De Travestis Oline

Part of my Project Progress

Buenos Días, aquí les adjunto el código y algunas capturas de pantalla del avance que llevo en mi proyecto.
Por el momento cuento con un menú con 3 opciones Agregar Productos, Mostrar Listado, Salir.

La Clase Grocery main, here is the main menu options to access the system.

package
 advance; 
java.util.Scanner import;
Grocery
{public class

public static void main (String [] args) / / main function {
Scanner
read = new Scanner (System.in); / / declaration of the scanner to read the data entered by the keyboard

Product Name = new Product (); / / create a class object to bind the Grocery with Product Inventory
print = new Inventory (); / / create an object to link the class with Inventory
Grocery
int op = 0, / / \u200b\u200bthis variable controls the choice of program you want to access the

System.out.println ("Warehouse Cuellar") System.out.println
("==================
===============");
do
{System.out.println ("Choose one
:..."); System.out.println (" [1 ] To Enter Products-> ") / / menu of options
System.out.println (" [2] Show Inventory -> ");
System.out.println (" [3] To Finish ") ;
do

Lectura.nextInt
{op = ();}


while (op! = 1 & & op! = 2 & & op! = 3);
switch (op)

{case 1: Nombre.ingproducto ();
break;
case 2: imprimir.printlist (Name),
break;
case 3: System.out.println ("End Program"); \u200b\u200b
break;}


} while (op! = 3);}


}

Then there's the Product class that is responsible for receiving data for generating the inventory of products sold in the business.

package
 advance; 
import
java.util.Scanner;
import java.util .*;
import java.lang .*;

public class Product {public



String name;
private int ID, Quantity / / named attributes to add products
private float price;

List
list = new ArrayList (); / / generate lists of data that we store
List list = new ArrayList (); / / List the inventory
listcant = new ArrayList ();
List listprice = new ArrayList ();
protected void

ingproducto () / / method which accede to enter
products
{Integer ID = new Integer (0); / / create an object to store integer data
Float price = new Float (0); / / create a data object to store a floating
Scanner
reading = new Scanner (System.in);

System.out.println ("Product Data Entry);
System.out.println ("================= ============"); / / Menu of options for discharging a product
System.out.println ("Enter the Name->");
lectura.nextLine Name = () / / save the name
list.add (Name ) / / add to the list
System.out.println ("Enter Product ID->");
lectura.nextInt ID = () / / save the ID
listid.add (ID); / / add to the list
System.out.println ("Enter the number of products available->");
lectura.nextInt Quantity = (); / / save the amount
listcant.add (Quantity) / / add
the list System.out.println ("Enter the Product Price->");
lectura.nextFloat Price = () / / keep the price
listprice.add (Price) / / add to the list

}}




And finally there is the Inventory class, responsible for generating and storing the list of products added since the option to add and is accessed from the main menu to access the inventory that has been generated so far.

package
 advance; 
import java.util .*;
public class
Inventory

{static void

printList (Product print) {/ / static method for product entries from
/ / and print, is also the method to access the inventory listing generated

System.out.println ( "Inventory List \\ n");
imprimir.list.iterator Iterator iter = (); / / through the list of names of stored products and print
while (iter.hasNext ())
System.out.println (" Name: "+ iter.next ());
imprimir.listid.iterator
Iterator iter = ();
while (itera.hasNext ()) / / go the list of ID's saved and printed
System.out.println ("ID:" + itera.next ());
iterac = imprimir.listcant.iterator
Iterator ();
while (iterac.hasNext ()) / / through the list of quantities of products stored and printed
System.out.println ("Available:" + iterac.next ());
iteration = imprimir.listprice.iterator
Iterator (); / / through the list of prices saved and printed products
while (iteraci.hasNext ())
System.out.println ("Unit Price:" + iteraci.next ());

}}
Finally
herewith a Screenshots with building and running the program.