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.

0 comments:

Post a Comment