Está en la página 1de 60

Especialidad:

Computacin e Informtica
Tema:
SISTEMA PARA CONTROL DE MEDICAMENTOS,
CLIENTES Y PUNTOS BONO PARA UNA FARMACIA
Autores:
Mamani Vega Summer
Hancco Andia Jean Carlos
Curso:
Anlisis y Diseo de Sistema
Docente:
Mg. Manuel Alczar Holguin
Ao acadmico:
2014
Semestre:
4 Semestre
Fecha de presentacin:
Martes 11 de Noviembre

ndice
I. INTRODUCCION.......................................................................................... 4
II. DESARROLLO DEL TEMA DE INVESTIGACIN..............................................4
2.1 Bases Tericas...................................................................................... 4
2.2 Hiptesis.............................................................................................. 7
2.2 Manual del Programador......................................................................7
2.3 Manual de Uso..................................................................................... 7
III. Conclusiones.......................................................................................... 13
IV. Bibliografa.............................................................................................. 14

I. INTRODUCCION
En el siguiente documento se describe el posible funcionamiento del
sistema para control de medicamentos, clientes y puntos bono para una
farmacia.
Los objetivos son desarrollar un posible sistema de farmacia a travs del
cual se examina su funcionamiento y los niveles de complejidad que ha
llegado a tener
DESCRIPCION
Se utilizara un lenguaje de programacin libre del cual hablamos de JAVA en
el cual estar desarrollndose en un entorno consola con la ayuda del
software IDE NetBeans a travs de mtodos y aplicando estructuras
condicionales, simples, anidadas y multiples como estructuras selectivas de
control ayudados de arreglos.
Las limitaciones que hemos encontrado son que los datos almacenados no
son reutilizables cuando finaliza el programa al trabajar un entorno consola
hacemos que el desarrollo sea menos agradable para el usuario
Esperemos que el desarrollo de este posible sistema sea til.

II. DESARROLLO DEL TEMA DE INVESTIGACIN

2.2 Manual del Programador

package Console;
import java.util.*;
public class Home {
int mod,f,d,a,n,no,u,p,i,v,sel; int elemen1=0;
String DNI[]=new String[0];String DNI_D[]=new String[0];
String Apellidos[]=new String[0];String Apellidos_A[]=new String[0];
String Nombres[]=new String[0];String Nombres_N[]=new String[0];
String Usu[]=new String[0];String Usu_U[]=new String[0];
String Pass[]= new String[0];String Pass_P[]= new String[0];
String DESCRIP[]=new String[0];String DESCRIP_D[]=new String[0];
String DESPRES[]=new String[0];String DESPRES_D[]=new String[0];
String NOMEDI[]=new String[0];String NOMEDI_N[]=new String[0];
String COMPQUIM[]=new String[0];String COMPQUIM_C[]=new String[0];
String CANTIDA[]=new String[0];String CANTIDA_C[]=new String[0];
String PRECUNI[]=new String[0];String PRECUNI_P[]=new String[0];
String FECVEN[]=new String[0];String FECVEN_F[]=new String[0];
String DNIC[]=new String[0];String DNIC_D[]=new String[0];
String Apelli[]=new String[0];String Apelli_A[]=new String[0];
String Nombr[]=new String[0];String Nombr_N[]=new String[0];
String Puntos[]=new String[0];String Puntos_P[]=new String[0];
String TIPSELECT[]=new String[0];String TIPSELECT_T[]=new String[0];
String PRESELCT[]=new String[0];String PRESELCT_P[]=new String[0];
String VENCANTI[]=new String[0];String VENCANTI_V[]=new String[0];
String VENFEC[]=new String[0];String VENFEC_V[]=new String[0];
String camp,most,ver,opv,elem1,elem2,parde,parpre;

public static Scanner lee=new Scanner(System.in);


public static void main(String[] args) {
Logeo us=new Logeo();
System.out.println("******** FARMACIA EL PAQUITO ********");
us.usuario();
}
public void Vienvenido(String us){
System.out.println("\nBienvenido Usuario: "+us+"\n\n");
Home();
}
public void Home(){
System.out.println("\n\n\t\t******** MENU DE OPCIONES ********");
System.out.println("[1] Administrar Usuarios del sistema");
System.out.println("[2] Administrar tipos de medicamentos");
System.out.println("[3] Administrar formas de presentacin de
medicamentos");
System.out.println("[4] Administrar medicamentos");
System.out.println("[5] Administrar datos de cliente");
System.out.println("[6] Operaciones de venta");
System.out.println("[7] Reporte: Caja");
System.out.println("[8] Reporte: Clientes");
System.out.println("[9] Reporte: Compras");
System.out.println("[10] Reporte: Venta de usuario");
System.out.println("[11] Reporte: Ranking ventas");
System.out.println("[12] Salir");
opcion();
}
private void opcion(){
Scanner lee=new Scanner(System.in);
int op;
try{
System.out.print("Seleccione opcion: ");
op=lee.nextInt();
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
opcion();
}
else if(op==1){Admin();}
else if(op==2){AdmMedi();}
else if(op==3){AdmPresent();}
else if(op==4){AdmMedic();}
else if(op==5){AdmDatos();}
else if(op==6){OpeVentas();}
else if(op==7){RepoCaja();}
else if(op==8){RepoClie();}
else if(op==9){RepoComp();}
else if(op==10){RepoVenUs();}
else if(op==11){RepoRankVen();}

else if(op==12){
System.out.println("\nHasta pronto!...");
System.exit(0);
}else if(op>12){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
opcion();
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
opcion();
}
}
public void Admin() {
int op;
System.out.println("\n\n\t******** USUARIOS DEL SISTEMA ********");
System.out.println("[1] Registrar Usuario");
System.out.println("[2] Actualizar datos de usuario");
System.out.println("[3] Eliminar usuario");
System.out.println("[4] Regresar/Men-Home");
try{
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op1="s";
while(op1.equals("s")||op1.equals("S")){
if(DNI.length==0){
DNI=new String [1];
System.out.print("\nDNI: ");
DNI[0]=lee.next();
}
else if(DNI.length>0){
DNI_D=new String [DNI.length+1];
for(d=0;d<=(DNI.length-1);d++){
DNI_D[d]=DNI[d];
}
System.out.print("\nDNI: ");
camp=lee.next();
DNI_D[DNI_D.length-1]=camp;
DNI=new String [DNI_D.length];
for(d=0;d<=(DNI_D.length-1);d++){
DNI[d]=DNI_D[d];
}
}
if(Apellidos.length==0){
Apellidos=new String [1];

System.out.print("Apellidos: ");
Apellidos[0]=lee.next();
}
else if(Apellidos.length>0){
Apellidos_A=new String [Apellidos.length+1];
for(a=0;a<=(Apellidos.length-1);a++){
Apellidos_A[a]=Apellidos[a];
}
System.out.print("Apellidos: ");
camp=lee.next();
Apellidos_A[Apellidos_A.length-1]=camp;
Apellidos=new String [Apellidos_A.length];
for(a=0;a<=(Apellidos_A.length-1);a++){
Apellidos[a]=Apellidos_A[a];
}
}
if(Nombres.length==0){
Nombres=new String [1];
System.out.print("Nombres: ");
Nombres[0]=lee.next();
}
else if(Nombres.length>0){
Nombres_N=new String [Nombres.length+1];
for(n=0;n<=(Nombres.length-1);n++){
Nombres_N[n]=Nombres[n];
}
System.out.print("Nombres: ");
camp=lee.next();
Nombres_N[Nombres_N.length-1]=camp;
Nombres=new String [Nombres_N.length];
for(n=0;n<=(Nombres_N.length-1);n++){
Nombres[n]=Nombres_N[n];
}
}
if(Usu.length==0){
Usu=new String [1];
System.out.print("Usuario: ");
Usu[0]=lee.next();
}
else if(Usu.length>0){
Usu_U=new String [Usu.length+1];
for(u=0;u<=(Usu.length-1);u++){
Usu_U[u]=Usu[u];
}
System.out.print("Usuario: ");
camp=lee.next();

Usu_U[Usu_U.length-1]=camp;
Usu=new String [Usu_U.length];
for(u=0;u<=(Usu_U.length-1);u++){
Usu[u]=Usu_U[u];
}
}
if(Pass.length==0){
Pass=new String [1];
System.out.print("Contrasea: ");
Pass[0]=lee.next();
}
else if(Pass.length>0){
Pass_P=new String [Pass.length+1];
for(p=0;p<=(Pass.length-1);p++){
Pass_P[p]=Pass[p];
}
System.out.print("Contrasea: ");
camp=lee.next();
Pass_P[Pass_P.length-1]=camp;
Pass=new String [Pass_P.length];
for(p=0;p<=(Pass_P.length-1);p++){
Pass[p]=Pass_P[p];
}
}
System.out.print("\n\n[s]/[n] Otro registro?: ");op1=lee.next();
}
Admin();
break;
case 2:
String op2="s";
while(op2.equals("s")||op2.equals("S")){
if (DNI.length >= 1) {
most= "Registrados " + DNI.length + "\n\n";
for (i = 0; i <= (DNI.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " + DNI[i]+"
"+Apellidos[i]+" "+Nombres[i]+" "+Usu[i]+" "+Pass[i]+ "\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que desea
Modificar?: ");
opv=lee.next();
System.out.print("\nModificar:\n[1] DNI\n[2] Apellidos\n[3]
Nombres\n[4] Usuario\n[5] Contrasea\nSeleccionar: ");
mod=lee.nextInt();
switch(mod){
case 1:
if (Integer.parseInt(opv) <= DNI.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevo DNI: ");
DNI[n - 1] = lee.next();

most = "Registrados " + DNI.length + "\n\n";


for (i = 0; i <= (DNI.length - 1); i++) {
most= most + "Codigo " + (i + 1) + ": " +
DNI[i]+" "+Apellidos[i] +" "+Nombres[i]+" "+Usu[i]+" "+Pass[i] + "\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
case 2:
if (Integer.parseInt(opv) <= Apellidos.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevos Apellidos: ");
Apellidos[n - 1] = lee.next();
most = "Registrados " + Apellidos.length +
"\n\n";
for (i = 0; i <= (Apellidos.length - 1); i++) {
most= most + "Codigo " + (i + 1) + ": " +
DNI[i]+" "+Apellidos[i] +" "+Nombres[i]+" "+Usu[i]+" "+Pass[i] + "\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
case 3:
if (Integer.parseInt(opv) <= Nombres.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevos Nombres: ");
Nombres[n - 1] = lee.next();
most = "Registrados " + Nombres.length +
"\n\n";
for (i = 0; i <= (Nombres.length - 1); i++) {
most= most + "Codigo " + (i + 1) + ": " +
DNI[i]+" "+Apellidos[i] +" "+Nombres[i]+" "+Usu[i]+" "+Pass[i] + "\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
case 4:
if (Integer.parseInt(opv) <= Usu.length) {
n = Integer.parseInt(opv);

System.out.print("Nuevo Usuario: ");


Usu[n - 1] = lee.next();
most = "Registrados " + Usu.length + "\n\n";
for (i = 0; i <= (Usu.length - 1); i++) {
most= most + "Codigo " + (i + 1) + ": " +
DNI[i]+" "+Apellidos[i] +" "+Nombres[i]+" "+Usu[i]+" "+Pass[i] + "\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
case 5:
if (Integer.parseInt(opv) <= Pass.length) {
n = Integer.parseInt(opv);
System.out.print("Nueva Contrasea: ");
Pass[n - 1] = lee.next();
most = "Registrados " + Pass.length + "\n\n";
for (i = 0; i <= (Pass.length - 1); i++) {
most= most + "Codigo " + (i + 1) + ": " +
DNI[i]+" "+Apellidos[i] +" "+Nombres[i]+" "+Usu[i]+" "+Pass[i] + "\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.print("El codigo seleccionado no
existe!.");
}
break;
default:
if(mod<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
Admin();
}
else if(mod>5){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
Admin();
}
}
} else {
System.out.println("No hay Registros para Modificar.\n");
}
System.out.print("\n\n[s][n] Modificar otro?:
");op2=lee.next();

}
Admin();
break;
case 3:
String op3="s";
while(op3.equals("s")||op3.equals("S")){
if (DNI.length >= 1) {
most= "Registrados " + DNI.length + "\n\n";
for (i = 0; i <= (DNI.length - 1); i++) {
most = most + "Codigo " + (i + 1) + " : " + DNI[i]+"
"+Apellidos[i] +" "+Nombres[i]+" "+Usu[i]+" "+Pass[i] + "\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que desea
Eliminar?: ");
elemen1=lee.nextInt();
elemen1-=1;
if (elemen1 <= DNI.length - 1) {
for (i =elemen1; i <= (DNI.length - 1); i++) {
if (i != DNI.length - 1) {
DNI_D[i] = DNI[i + 1];}}
DNI= new String[DNI_D.length - 1];
most = "Registrados " + DNI.length + "\n\n";
for (i = 0; i <= (DNI.length - 1); i++) {
DNI[i] = DNI_D[i];
most =most + "Codigo " + (i + 1) + ": " + DNI[i]+"
"+Apellidos[i] +" "+Nombres[i]+" "+Usu[i]+" "+Pass[i] + "\n";
}
DNI_D = new String [DNI.length];
for (i = 0; i <= (DNI.length - 1); i++) {
DNI_D[i] = DNI[i];}
System.out.print("Dato Eliminado Exitosamente! \n\n" +
most);
} else {
System.err.println("El Codigo Seleccionado no existe.
\n\n");
}
} else if (DNI.length == 0) {
DNI = new String [0];
DNI_D= new String [0];
System.out.println("El Registro se encuentra vacio. \n");
} else {
System.err.println("No hay Registros para Eliminar.\n");
}
System.out.print("\n\n[s][n] Eliminar otro?: ");op3=lee.next();
}
Admin();
break;
case 4:
Home();

break;
default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
Admin();
}
else if(op>4){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
Admin();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
Admin();
}
}
public void AdmMedi() {
int op;
System.out.println("\n\n\t******** TIPOS DE MEDICAMENTOS ********");
System.out.println("[1] Registrar tipo");
System.out.println("[2] Actualizar tipo");
System.out.println("[3] Eliminar tipo");
System.out.println("[4] Regresar/Men-Home");
try{
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op1="s";
while(op1.equals("s")||op1.equals("S")){
if(DESCRIP.length==0){
DESCRIP=new String [1];
System.out.print("\nDescripcion: ");
DESCRIP[0]=lee.next();
}
else if(DESCRIP.length>0){
DESCRIP_D=new String [DESCRIP.length+1];
for(d=0;d<=(DESCRIP.length-1);d++){
DESCRIP_D[d]=DESCRIP[d];
}
System.out.print("\nDescripcion: ");

camp=lee.next();
DESCRIP_D[DESCRIP_D.length-1]=camp;
DESCRIP=new String [DESCRIP_D.length];
for(d=0;d<=(DESCRIP_D.length-1);d++){
DESCRIP[d]=DESCRIP_D[d];
}
}
System.out.print("\n\n[s]/[n] Otro registro?:
");op1=lee.next();
}
AdmMedi();
break;
case 2:
String op2="s";
while(op2.equals("s")||op2.equals("S")){
if (DESCRIP.length >= 1) {
most= "Registrados " + DESCRIP.length + "\n\n";
for (i = 0; i <= (DESCRIP.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " +
DESCRIP[i]+"\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que
desea Modificar?: ");
opv=lee.next();
if (Integer.parseInt(opv) <= DESCRIP.length) {
n = Integer.parseInt(opv);
System.out.print("Nueva Descripcion: ");
DESCRIP[n - 1] = lee.next();
most = "Numero de Registros " +
DESCRIP.length + "\n\n";
for (i = 0; i <= (DESCRIP.length - 1); i++) {
most= most + "Codigo " + (i + 1) + ": " +
DESCRIP[i]+ "\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
} else {
System.out.println("No hay Registros para Modificar.\n");
}
System.out.print("\n\n[s][n] Modificar otro?:
");op2=lee.next();
}
AdmMedi();

break;
case 3:
String op3="s";
while(op3.equals("s")||op3.equals("S")){
if (DESCRIP.length >= 1) {
most= "Registrados " + DESCRIP.length + "\n\n";
for (i = 0; i <= (DESCRIP.length - 1); i++) {
most = most + "Codigo " + (i + 1) + " : " + DESCRIP[i]+
"\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que desea
Eliminar?: ");
elemen1=lee.nextInt();
elemen1-=1;
if (elemen1 <= DESCRIP.length - 1) {
for (i =elemen1; i <= (DESCRIP.length - 1); i++) {
if (i != DESCRIP.length - 1) {
DESCRIP_D[i] = DESCRIP[i + 1];}}
DESCRIP= new String[DESCRIP_D.length - 1];
most = "Registrados " + DESCRIP.length + "\n\n";
for (i = 0; i <= (DESCRIP.length - 1); i++) {
DESCRIP[i] = DESCRIP_D[i];
most =most + "Codigo " + (i + 1) + ": " + DESCRIP[i]
+ "\n";
}
DESCRIP_D = new String [DESCRIP.length];
for (i = 0; i <= (DESCRIP.length - 1); i++) {
DESCRIP[i] = DESCRIP[i];
}
System.out.print("Dato Eliminado Exitosamente! \n\n" +
most);
} else {
System.err.println("El Codigo Seleccionado no existe.
\n\n");
}
} else if (DESCRIP.length == 0) {
DESCRIP = new String [0];
DESCRIP_D= new String [0];
System.out.println("El Registro se encuentra vacio. \n");
} else {
System.err.println("No hay Registros para Eliminar.\n");
}
System.out.print("\n\n[s][n] Eliminar otro?: ");op3=lee.next();
}
AdmMedi();
break;
case 4:
Home();
break;

default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
AdmMedi();
}
else if(op>4){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
AdmMedi();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
AdmMedi();
}
}
public void AdmPresent() {
int op;
System.out.println("\n\n\t******** PRESENTACION DE MEDICAMENTOS
********");
System.out.println("[1] Registrar presentacion");
System.out.println("[2] Actualizar presentacion");
System.out.println("[3] Eliminar presentacion");
System.out.println("[4] Regresar/Men-Home");
try{
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op1="s";
while(op1.equals("s")||op1.equals("S")){
if(DESPRES.length==0){
DESPRES=new String [1];
System.out.print("\nDescripcion: ");
DESPRES[0]=lee.next();
}
else if(DESPRES.length>0){
DESPRES_D=new String [DESPRES.length+1];
for(d=0;d<=(DESPRES.length-1);d++){
DESPRES_D[d]=DESPRES[d];
}
System.out.print("\nDescripcion: ");
camp=lee.next();

DESPRES_D[DESPRES_D.length-1]=camp;
DESPRES=new String [DESPRES_D.length];
for(d=0;d<=(DESPRES_D.length-1);d++){
DESPRES[d]=DESPRES_D[d];
}
}
System.out.print("\n\n[s]/[n] Otro registro?:
");op1=lee.next();
}
AdmPresent();
break;
case 2:
String op2="s";
while(op2.equals("s")||op2.equals("S")){
if (DESPRES.length >= 1) {
most= "Registrados " + DESPRES.length + "\n\n";
for (i = 0; i <= (DESPRES.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " +
DESPRES[i]+"\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que
desea Modificar?: ");
opv=lee.next();
if (Integer.parseInt(opv) <= DESPRES.length) {
n = Integer.parseInt(opv);
System.out.print("Nueva Descripcion: ");
DESPRES[n - 1] = lee.next();
most = "Registrados " + DESPRES.length +
"\n\n";
for (i = 0; i <= (DESPRES.length - 1); i++) {
most= most + "Codigo " + (i + 1) + ": " +
DESPRES[i]+ "\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
} else {
System.out.println("No hay Registros para Modificar.\n");
}
System.out.print("\n\n[s][n] Modificar otro?:
");op2=lee.next();
}
AdmPresent();
break;

case 3:
String op3="s";
while(op3.equals("s")||op3.equals("S")){
if (DESPRES.length >= 1) {
most= "Registrados " + DESPRES.length + "\n\n";
for (i = 0; i <= (DESPRES.length - 1); i++) {
most = most + "Codigo " + (i + 1) + " : " + DESPRES[i]
+ "\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que desea
Eliminar?: ");
elemen1=lee.nextInt();
elemen1-=1;
if (elemen1 <= DESPRES.length - 1) {
for (i =elemen1; i <= (DESPRES.length - 1); i++) {
if (i != DESPRES.length - 1) {
DESPRES_D[i] = DESPRES[i + 1];}}
DESPRES= new String[DESPRES_D.length - 1];
most = "Registrados " + DESPRES.length + "\n\n";
for (i = 0; i <= (DESPRES.length - 1); i++) {
DESPRES[i] = DESPRES_D[i];
most =most + "Codigo " + (i + 1) + ": " + DESPRES[i]
+ "\n";
}
DESPRES_D = new String [DESPRES.length];
for (i = 0; i <= (DESPRES.length - 1); i++) {
DESPRES[i] = DESPRES[i];
}
System.out.print("Dato Eliminado Exitosamente! \n\n" +
most);
} else {
System.err.println("El Codigo Seleccionado no existe.
\n\n");
}
} else if (DESPRES.length == 0) {
DESPRES = new String [0];
DESPRES_D= new String [0];
System.out.println("El Registro se encuentra vacio. \n");
} else {
System.err.println("No hay Registros para Eliminar.\n");
}
System.out.print("\n\n[s][n] Eliminar otro?: ");op3=lee.next();
}
AdmPresent();
break;
case 4:
Home();
break;
default:

if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
AdmPresent();
}
else if(op>4){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
AdmPresent();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
AdmPresent();
}
}
public void AdmMedic() {
int op;
Scanner lee=new Scanner(System.in);
System.out.println("\n\n\t******** MEDICAMENTOS ********");
System.out.println("[1] Registrar Medicamento");
System.out.println("[2] Actualizar datos del medicamento");
System.out.println("[3] Eliminar Medicamento");
System.out.println("[4] Regresar/Men-Home");
try{
parpre="";parde="";most="";
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op1="s";
while(op1.equals("s")||op1.equals("S")){
if (DESCRIP.length >= 1) {
for (i = 0; i <= (DESCRIP.length - 1); i++) {
parde= parde + "Codigo " + (i + 1) + ": " + DESCRIP[i]+
"\n";
}
System.out.println("\nTipos de medicamentos");
System.out.print(parde);
System.out.print("Tipo de medicamento a seleccionar?: ");
camp=lee.next();
sel = Integer.parseInt(camp);
if(DESCRIP.length==(sel-1)){
if(TIPSELECT.length==0){

TIPSELECT=new String [1];


TIPSELECT[0]=DESCRIP[i];
}
else if(TIPSELECT.length>0){
TIPSELECT_T=new String [TIPSELECT.length+1];
for(d=0;d<=(TIPSELECT.length-1);d++){
TIPSELECT_T[d]=TIPSELECT[d];
}
TIPSELECT_T[TIPSELECT_T.length-1]=DESCRIP[i];
TIPSELECT=new String [TIPSELECT_T.length];
for(d=0;d<=(TIPSELECT_T.length-1);d++){
TIPSELECT[d]=TIPSELECT_T[d];
}
}
}
} else {
System.err.println("\nNo hay Tipo de medicamentos\n");
}
if (DESPRES.length >= 1) {
for (i = 0; i <= (DESPRES.length - 1); i++) {
parpre= parpre + "Codigo " + (i + 1) + ": " + DESPRES[i]
+ "\n";
}
System.out.println("\nPresentacion de medicamentos");
System.out.print(parpre);
System.out.print("Forma de presentacion a seleccionar?: ");
camp=lee.next();
sel = Integer.parseInt(camp);
if(DESPRES.length==(sel-1)){
if(PRESELCT.length==0){
PRESELCT=new String [1];
PRESELCT[0]=DESPRES[i];
}
else if(PRESELCT.length>0){
PRESELCT_P=new String [PRESELCT.length+1];
for(d=0;d<=(PRESELCT.length-1);d++){
PRESELCT_P[d]=PRESELCT[d];
}
PRESELCT_P[PRESELCT_P.length-1]=DESPRES[i];
PRESELCT=new String [PRESELCT_P.length];
for(d=0;d<=(PRESELCT_P.length-1);d++){
PRESELCT[d]=PRESELCT_P[d];
}
}
}
} else {

System.err.println("\nNo hay Presentacion del


medicamento\n");
}
if(NOMEDI.length==0){
NOMEDI=new String [1];
System.out.print("\nNombre medicamento: ");
NOMEDI[0]=lee.next();
}
else if(NOMEDI.length>0){
NOMEDI_N=new String [NOMEDI.length+1];
for(d=0;d<=(NOMEDI.length-1);d++){
NOMEDI_N[d]=NOMEDI[d];
}
System.out.print("\nNombre medicamento: ");
camp=lee.next();
NOMEDI_N[NOMEDI_N.length-1]=camp;
NOMEDI=new String [NOMEDI_N.length];
for(d=0;d<=(NOMEDI_N.length-1);d++){
NOMEDI[d]=NOMEDI_N[d];
}
}
if(COMPQUIM.length==0){
COMPQUIM=new String [1];
System.out.print("Compuesto qumico: ");
COMPQUIM[0]=lee.next();
}
else if(COMPQUIM.length>0){
COMPQUIM_C=new String [COMPQUIM.length+1];
for(a=0;a<=(COMPQUIM.length-1);a++){
COMPQUIM_C[a]=COMPQUIM[a];
}
System.out.print("Compuesto qumico: ");
camp=lee.next();
COMPQUIM_C[COMPQUIM_C.length-1]=camp;
COMPQUIM=new String [COMPQUIM_C.length];
for(a=0;a<=(COMPQUIM_C.length-1);a++){
COMPQUIM[a]=COMPQUIM_C[a];
}
}
if(CANTIDA.length==0){
CANTIDA=new String [1];
System.out.print("Cantidad disponible: ");
CANTIDA[0]=lee.next();
}
else if(CANTIDA.length>0){

CANTIDA_C=new String [CANTIDA.length+1];


for(n=0;n<=(CANTIDA.length-1);n++){
CANTIDA_C[n]=CANTIDA[n];
}
System.out.print("Cantidad disponible: ");
camp=lee.next();
CANTIDA_C[CANTIDA_C.length-1]=camp;
CANTIDA=new String [CANTIDA_C.length];
for(n=0;n<=(CANTIDA_C.length-1);n++){
CANTIDA[n]=CANTIDA_C[n];
}
}
if(PRECUNI.length==0){
PRECUNI=new String [1];
System.out.print("Precio unitario: ");
PRECUNI[0]=lee.next();
}
else if(PRECUNI.length>0){
PRECUNI_P=new String [PRECUNI.length+1];
for(u=0;u<=(PRECUNI.length-1);u++){
PRECUNI_P[u]=PRECUNI[u];
}
System.out.print("Precio unitario: ");
camp=lee.next();
PRECUNI_P[PRECUNI_P.length-1]=camp;
PRECUNI=new String [PRECUNI_P.length];
for(u=0;u<=(PRECUNI_P.length-1);u++){
PRECUNI[u]=PRECUNI_P[u];
}
}
if(FECVEN.length==0){
FECVEN=new String [1];
System.out.print("Fecha de vencimiento: ");
FECVEN[0]=lee.next();
}
else if(FECVEN.length>0){
FECVEN_F=new String [FECVEN.length+1];
for(v=0;v<=(FECVEN.length-1);v++){
FECVEN_F[v]=FECVEN[v];
}
System.out.print("Fecha de vencimiento: ");
camp=lee.next();
FECVEN_F[FECVEN_F.length-1]=camp;
FECVEN=new String [FECVEN_F.length];
for(v=0;v<=(FECVEN_F.length-1);v++){

FECVEN[v]=FECVEN_F[v];
}
}
System.out.print("\n\n[s]/[n] Otro registro?: ");op1=lee.next();
}
AdmMedic();
break;
case 2:
String op2="s";
while(op2.equals("s")||op2.equals("S")){
if (NOMEDI.length >= 1) {
most= "Registrados " + NOMEDI.length + "\n\n";
for (i = 0; i <= (NOMEDI.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": "+TIPSELECT[i]
+" "+PRESELCT[i]+" "+ NOMEDI[i]+" "+COMPQUIM[i]+" "+CANTIDA[i]+"
"+PRECUNI[i]+" "+FECVEN[i]+"\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que desea
Modificar?: ");
opv=lee.next();
System.out.print("\nModificar:\n[1] Nombre del
medicamento\n[2] Compuesto Quimico\n[3] Cantidad Disponible\n[4] Precio
Unitario\n[5] Fecha vencimiento\nSeleccionar: ");
mod=lee.nextInt();
switch(mod){
case 1:
if (Integer.parseInt(opv) <= NOMEDI.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevo Nombre: ");
NOMEDI[n - 1] = lee.next();
most = "Registrados " + NOMEDI.length +
"\n\n";
for (i = 0; i <= (NOMEDI.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": "
+TIPSELECT[i]+" "+PRESELCT[i]+" "+NOMEDI[i]+" "+COMPQUIM[i]+"
"+CANTIDA[i]+" "+PRECUNI[i]+" "+FECVEN[i]+"\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
case 2:
if (Integer.parseInt(opv) <= COMPQUIM.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevo compuesto quimico: ");
COMPQUIM[n - 1] = lee.next();

most = "Registrados " + COMPQUIM.length +


"\n\n";
for (i = 0; i <= (COMPQUIM.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": "
+TIPSELECT[i]+" "+PRESELCT[i]+" "+NOMEDI[i]+" "+COMPQUIM[i]+"
"+CANTIDA[i]+" "+PRECUNI[i]+" "+FECVEN[i]+"\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
case 3:
if (Integer.parseInt(opv) <= CANTIDA.length) {
n = Integer.parseInt(opv);
System.out.print("Nueva cantidad: ");
CANTIDA[n - 1] = lee.next();
most = "Registrados " + CANTIDA.length +
"\n\n";
for (i = 0; i <= (CANTIDA.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": "
+TIPSELECT[i]+" "+PRESELCT[i]+" "+NOMEDI[i]+" "+COMPQUIM[i]+"
"+CANTIDA[i]+" "+PRECUNI[i]+" "+FECVEN[i]+"\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
case 4:
if (Integer.parseInt(opv) <= PRECUNI.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevo precio unitario: ");
PRECUNI[n - 1] = lee.next();
most = "Registrados " + PRECUNI.length +
"\n\n";
for (i = 0; i <= (PRECUNI.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " +
NOMEDI[i]+" "+COMPQUIM[i]+" "+CANTIDA[i]+" "+PRECUNI[i]+"
"+FECVEN[i]+"\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}

break;
case 5:
if (Integer.parseInt(opv) <= FECVEN.length) {
n = Integer.parseInt(opv);
System.out.print("Nueva fecha de vencimiento:
");
FECVEN[n - 1] = lee.next();
most = "Registrados " + FECVEN.length +
"\n\n";
for (i = 0; i <= (FECVEN.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " +
NOMEDI[i]+" "+COMPQUIM[i]+" "+CANTIDA[i]+" "+PRECUNI[i]+"
"+FECVEN[i]+"\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
default:
if(mod<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
}
else if(mod>5){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
}
}
} else {
System.out.println("No hay Registros para Modificar.\n");
}
System.out.print("\n\n[s][n] Modificar otro?:
");op2=lee.next();
}
AdmMedic();
break;
case 3:
String op4="s";
while(op4.equals("s")||op4.equals("S")){
if (NOMEDI.length >= 1) {
most= "Registrados " + NOMEDI.length + "\n\n";
for (i = 0; i <= (NOMEDI.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " + NOMEDI[i]+"
"+COMPQUIM[i]+" "+CANTIDA[i]+" "+PRECUNI[i]+" "+FECVEN[i]+"\n";

}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que desea
Eliminar?: ");
elemen1=lee.nextInt();
elemen1-=1;
if (elemen1 <= NOMEDI.length - 1) {
for (i =elemen1; i <= (NOMEDI.length - 1); i++) {
if (i != NOMEDI.length - 1) {
NOMEDI_N[i] = NOMEDI[i + 1];}}
NOMEDI= new String[NOMEDI_N.length - 1];
most = "Registrados " + NOMEDI.length + "\n\n";
for (i = 0; i <= (NOMEDI.length - 1); i++) {
NOMEDI[i] = NOMEDI_N[i];
most = most + "Codigo " + (i + 1) + ": " + NOMEDI[i]
+" "+COMPQUIM[i]+" "+CANTIDA[i]+" "+PRECUNI[i]+" "+FECVEN[i]+"\n";
}
NOMEDI_N = new String [NOMEDI.length];
for (i = 0; i <= (NOMEDI.length - 1); i++) {
NOMEDI_N[i] = NOMEDI[i];}
System.out.print("Dato Eliminado Exitosamente! \n\n" +
most);
} else {
System.err.println("El Codigo Seleccionado no existe.
\n\n");
}
} else if (NOMEDI.length == 0) {
NOMEDI = new String [0];
NOMEDI_N= new String [0];
System.out.println("El Registro se encuentra vacio. \n");
} else {
System.err.println("No hay Registros para Eliminar.\n");
}
System.out.print("\n\n[s][n] Eliminar otro?: ");op4=lee.next();
}
AdmMedic();
break;
case 4:
Home();
break;
default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
AdmMedic();
}
else if(op>4){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");

AdmMedic();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
AdmMedic();
}
}
public void AdmDatos(){
int op;
Scanner lee=new Scanner(System.in);
System.out.println("\n\n\t******** DATOS DE CLIENTE ********");
System.out.println("[1] Registrar cliente");
System.out.println("[2] Actualizar datos de cliente");
System.out.println("[3] Actualizar puntos bono");
System.out.println("[4] Eliminar usuario");
System.out.println("[5] Regresar/Men-Home");
try{
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op1="s";
while(op1.equals("s")||op1.equals("S")){
if(DNIC.length==0){
DNIC=new String [1];
System.out.print("\nDNI: ");
DNIC[0]=lee.next();
}
else if(DNIC.length>0){
DNIC_D=new String [DNIC.length+1];
for(d=0;d<=(DNIC.length-1);d++){
DNIC_D[d]=DNIC[d];
}
System.out.print("\nDNI: ");
camp=lee.next();
DNIC_D[DNIC_D.length-1]=camp;
DNIC=new String [DNIC_D.length];
for(d=0;d<=(DNIC_D.length-1);d++){
DNIC[d]=DNIC_D[d];
}
}
if(Apelli.length==0){
Apelli=new String [1];
System.out.print("Apellidos: ");
Apelli[0]=lee.next();
}

else if(Apelli.length>0){
Apelli_A=new String [Apelli.length+1];
for(a=0;a<=(Apelli.length-1);a++){
Apelli_A[a]=Apelli[a];
}
System.out.print("Apellidos: ");
camp=lee.next();
Apelli_A[Apelli_A.length-1]=camp;
Apelli=new String [Apelli_A.length];
for(a=0;a<=(Apelli_A.length-1);a++){
Apelli[a]=Apelli_A[a];
}
}
if(Nombr.length==0){
Nombr=new String [1];
System.out.print("Nombres: ");
Nombr[0]=lee.next();
}
else if(Nombr.length>0){
Nombr_N=new String [Nombr.length+1];
for(n=0;n<=(Nombr.length-1);n++){
Nombr_N[n]=Nombr[n];
}
System.out.print("Nombres: ");
camp=lee.next();
Nombr_N[Nombr_N.length-1]=camp;
Nombr=new String [Nombr_N.length];
for(n=0;n<=(Nombr_N.length-1);n++){
Nombr[n]=Nombr_N[n];
}
}
if(Puntos.length==0){
Puntos=new String [1];
System.out.print("Puntos Bono: ");
Puntos[0]=lee.next();
}
else if(Puntos.length>0){
Puntos_P=new String [Puntos.length+1];
for(u=0;u<=(Puntos.length-1);u++){
Puntos_P[u]=Puntos[u];
}
System.out.print("Puntos Bono: ");
camp=lee.next();
Puntos_P[Puntos_P.length-1]=camp;
Puntos=new String [Puntos_P.length];
for(u=0;u<=(Puntos_P.length-1);u++){

Puntos[u]=Puntos_P[u];
}
}
System.out.print("\n\n[s]/[n] Otro registro?: ");op1=lee.next();
}
AdmDatos();
break;
case 2:
String op2="s";
while(op2.equals("s")||op2.equals("S")){
if (DNIC.length >= 1) {
most= "Registrados " + DNIC.length + "\n\n";
for (i = 0; i <= (DNIC.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " + DNIC[i]+"
"+Apelli[i]+" "+Nombr[i]+"\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que desea
Modificar?: ");
opv=lee.next();
System.out.print("\nModificar:\n[1] DNI\n[2] Apellidos\n[3]
Nombres\nSeleccionar: ");
mod=lee.nextInt();
switch(mod){
case 1:
if (Integer.parseInt(opv) <= DNIC.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevo DNI: ");
DNIC[n - 1] = lee.next();
most = "Registrados " + DNIC.length + "\n\n";
for (i = 0; i <= (DNIC.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " +
DNIC[i]+" "+Apelli[i]+" "+Nombr[i]+"\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
case 2:
if (Integer.parseInt(opv) <= Apelli.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevos Apellidos: ");
Apelli[n - 1] = lee.next();
most = "Registrados " + Apelli.length + "\n\n";
for (i = 0; i <= (Apelli.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " +
DNIC[i]+" "+Apelli[i]+" "+Nombr[i]+"\n";

}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
case 3:
if (Integer.parseInt(opv) <= Nombr.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevos Nombres: ");
Nombr[n - 1] = lee.next();
most = "Registrados " + Nombr.length + "\n\n";
for (i = 0; i <= (Nombr.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " +
DNIC[i]+" "+Apelli[i]+" "+Nombr[i]+"\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
break;
default:
if(mod<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
}
else if(mod>3){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
}
}
} else {
System.out.println("No hay Registros para Modificar.\n");
}
System.out.print("\n\n[s][n] Modificar otro?:
");op2=lee.next();
}
AdmDatos();
break;
case 3:
String op3="s";
while(op3.equals("s")||op3.equals("S")){
if (Puntos.length >= 1) {

most= "Registrados " + Puntos.length + "\n\n";


for (i = 0; i <= (Puntos.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " + DNIC[i]+"
"+Apelli[i]+" "+Nombr[i]+" "+Puntos[i]+"\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que desea
Modificar?: ");
opv=lee.next();
if (Integer.parseInt(opv) <= Puntos.length) {
n = Integer.parseInt(opv);
System.out.print("Nuevos Puntos Bono: ");
Puntos[n - 1] = lee.next();
most = "Registrados " + Puntos.length + "\n\n";
for (i = 0; i <= (Puntos.length - 1); i++) {
most = most + "Codigo " + (i + 1) + ": " +
DNIC[i]+" "+Apelli[i]+" "+Nombr[i]+" "+Puntos[i]+"\n";
}
System.out.print("Registro Modificado
Exitosamente! "+most);
} else {
System.err.println("El codigo seleccionado no
existe!.\n");
}
} else {
System.out.println("No hay Registros para Modificar.\n");
}
System.out.print("\n\n[s][n] Modificar otro?:
");op3=lee.next();
}
AdmDatos();
break;
case 4:
String op4="s";
while(op4.equals("s")||op4.equals("S")){
if (DNIC.length >= 1) {
most= "Registrados " + DNIC.length + "\n\n";
for (i = 0; i <= (DNIC.length - 1); i++) {
most = most + "Codigo " + (i + 1) + " : " + DNIC[i]+"
"+Apelli[i] +" "+Nombr[i]+" "+Puntos[i]+"\n";
}
System.out.print(most);
System.out.print("Cual es el codigo del Registro que desea
Eliminar?: ");
elemen1=lee.nextInt();
elemen1-=1;
if (elemen1 <= DNIC.length - 1) {
for (i =elemen1; i <= (DNIC.length - 1); i++) {
if (i != DNIC.length - 1) {

DNIC_D[i] = DNIC[i + 1];}}


DNIC= new String[DNIC_D.length - 1];
most = "Registrados " + DNIC.length + "\n\n";
for (i = 0; i <= (DNIC.length - 1); i++) {
DNIC[i] = DNIC_D[i];
most = most + "Codigo " + (i + 1) + " : " + DNIC[i]
+" "+Apelli[i] +" "+Nombr[i]+" "+Puntos[i]+"\n";
}
DNIC_D = new String [DNIC.length];
for (i = 0; i <= (DNIC.length - 1); i++) {
DNIC_D[i] = DNIC[i];}
System.out.print("Dato Eliminado Exitosamente! \n\n" +
most);
} else {
System.err.println("El Codigo Seleccionado no existe.
\n\n");
}
} else if (DNIC.length == 0) {
DNIC = new String [0];
DNIC_D= new String [0];
System.out.println("El Registro se encuentra vacio. \n");
} else {
System.err.println("No hay Registros para Eliminar.\n");
}
System.out.print("\n\n[s][n] Eliminar otro?: ");op4=lee.next();
}
AdmDatos();
break;
case 5:
Home();
break;
default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
AdmDatos();
}
else if(op>5){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
AdmDatos();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
AdmDatos();

}
}
public void OpeVentas(){
int op;
System.out.println("\n\n\t******** OPERACIONES DE VENTA ********");
System.out.println("[1] Registrar Operaciones");
System.out.println("[2] Regresar/Men-Home");
try{
ver="";
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op4="s";
while(op4.equals("s")||op4.equals("S")){
if (DNIC.length >= 1) {
System.out.print("Ingrese DNI del cliente: ");
camp=lee.next();
for (i = 0; i <= (DNIC.length - 1); i++) {
ver = ver + "Codigo " + (i + 1) + ": " + DNIC[i]+"
"+Apelli[i]+" "+Nombr[i]+"\n";
if(DNIC[i].equals(camp)){
System.out.print("** Cliente registrado! **\n");
break;
}else{
String op6;
System.out.println("No se ha encontrado!");
System.out.print("[s][n] Registrar Usuario?: ");
op6=lee.next();
if(op6.equals("s")||op6.equals("S")){
AdmDatos();
}
OpeVentas();
}
}
}
if (NOMEDI.length >= 1) {
System.out.print("Ingrese Nombre del medicamento: ");
camp=lee.next();ver="";
for (i = 0; i <= (NOMEDI.length - 1); i++) {
ver = ver + "Codigo " + (i + 1) + ": "+ NOMEDI[i]+"\n";
if(NOMEDI[i].equals(camp)){
System.out.print("** Medicamento registrado! **\n");
}else{
String op6="s";
System.out.println("Medicamento no registrado!");
System.out.print("[s][n] Registrar medicamento?: ");
op6=lee.next();
if(op6.equals("s")||op6.equals("S")){
AdmMedi();
}

OpeVentas();
}
}
}else{
String op6="s";
System.out.print("Medicamento no registrado!");
System.out.print("[s][n] Registrar medicamento?: ");
op6=lee.next();
if(op6.equals("s")||op6.equals("S")){
AdmMedi();
}
OpeVentas();
}
if(VENCANTI.length==0){
VENCANTI=new String [1];
System.out.print("\nCantidad a comprar: ");
VENCANTI[0]=lee.next();
}
else if(VENCANTI.length>0){
VENCANTI_V=new String [VENCANTI.length+1];
for(d=0;d<=(VENCANTI.length-1);d++){
VENCANTI_V[d]=VENCANTI[d];
}
System.out.print("\nCantidad a comprar: ");
camp=lee.next();
VENCANTI_V[VENCANTI_V.length-1]=camp;
VENCANTI=new String [VENCANTI_V.length];
for(d=0;d<=(VENCANTI_V.length-1);d++){
VENCANTI[d]=VENCANTI_V[d];
}
}
if(VENFEC.length==0){
VENFEC=new String [1];
System.out.print("\nFecha de compra: ");
VENFEC[0]=lee.next();
}
else if(VENFEC.length>0){
VENFEC_V=new String [VENFEC.length+1];
for(d=0;d<=(VENFEC.length-1);d++){
VENFEC_V[d]=VENFEC[d];
}
System.out.print("\nCantidad a comprar: ");
camp=lee.next();
VENFEC_V[VENFEC_V.length-1]=camp;
VENFEC=new String [VENFEC_V.length];
for(d=0;d<=(VENFEC_V.length-1);d++){
VENFEC[d]=VENFEC_V[d];

}
}
ver="";
for (i = 0; i <= (VENCANTI.length - 1); i++) {
ver = ver + "Codigo: " + (i + 1) + "\n"+"DNI: "+
DNIC[i]+"\nApellidos: "+Apelli[i]+"\nNombres: "+Nombr[i]
+"\nMedicamentos: "+NOMEDI[i]+"\nCantidad: "+VENCANTI[i]+"\nFecha:
"+VENFEC[i]+"\n";
}
System.out.println("\nVenta realizada: ");
System.out.print(ver);

System.out.print("\n\n[s][n] Hacer otra operacion?:


");op4=lee.next();
}
OpeVentas();
break;
case 2:
Home();
break;
default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
OpeVentas();
}
else if(op>2){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
OpeVentas();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
System.err.println(ex.toString());
OpeVentas();
}
}
public void RepoCaja(){
int op;
System.out.println("\n\n\t******** REPORTE DE CAJA ********");
System.out.println("[1] Mostrar reporte caja");
System.out.println("[2] Regresar/Men-Home");
try{
ver="";

System.out.print("Ingrese opcion: ");


op=lee.nextInt();
switch(op){
case 1:
String op4="s",ver3="";
while(op4.equals("s")||op4.equals("S")){
if (VENCANTI.length >= 1) {
System.out.print("Ingrese fecha: ");
camp=lee.next();ver="";
for (i = 0; i <= (VENCANTI.length - 1); i++) {
ver = ver +NOMEDI[i]+"\n";
ver3 = ver3 + CANTIDA[i]+"\n";
if(VENFEC[i].equals(camp)){
System.out.print("Reporte de ventas de: "+camp);
System.out.print("\nUsuario: Samm");
System.out.println("\nMedicamento\t"+"Monto
recuadado");
System.out.print(ver+"\n");
}
}
}
System.out.print("\n\n[s][n] Hacer otro reporte?:
");op4=lee.next();
}
RepoCaja();
break;
case 2:
Home();
break;
default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
RepoCaja();
}
else if(op>2){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
RepoCaja();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
RepoCaja();

}
}
public void RepoClie(){
int op;
System.out.println("\n\n\t******** REOPORTE CLIENTE ********");
System.out.println("[1] Mostrar reporte clientes");
System.out.println("[2] Regresar/Men-Home");
try{
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op4="s",ver2="",ver3="",ver1="";
while(op4.equals("s")||op4.equals("S")){
if (DNIC.length >= 1) {
System.out.print("Ingrese DNI: ");
camp=lee.next();ver="";
for (i = 0; i <= (DNIC.length - 1); i++) {
ver = ver +Nombr[i]+" "+Apelli[i]+"\n";
ver1 = ver1+NOMEDI[i]+"\t\t"+CANTIDA[i]+"\n";
ver2 = ver2 + Puntos[i]+"\n";
if(DNIC[i].equals(camp)){
System.out.print("Cliente: "+ver);
System.out.print(" Usuario: Samm");
System.out.println("\nPuntos bono: "+ver2+"\t");
System.out.println("\nMedicamento\t"+"Cantidad\t"+"Monto
recuadado\t"+"Fecha\n");
System.out.print(ver1+"\n");
}
}
}
System.out.print("\n\n[s][n] Hacer otro reporte?:
");op4=lee.next();
}
RepoClie();
break;
case 2:
Home();
break;
default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
RepoClie();
}
else if(op>2){
System.err.println("**********************");

System.err.println("* Opcion incorrecta! *");


System.err.println("**********************");
RepoClie();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
RepoClie();
}
}
public void RepoComp(){
int op;
System.out.println("\n\n\t******** REPORTE DE COMPRAS ********");
System.out.println("[1] Mostrar reporte compras");
System.out.println("[2] Regresar/Men-Home");
try{
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op4="s",ver3="";
while(op4.equals("s")||op4.equals("S")){
if (NOMEDI.length >= 1) {
ver="";
for (i = 0; i <= (DNIC.length - 1); i++) {
ver = ver +NOMEDI[i]+"\n";
ver3 = ver3 + CANTIDA[i]+"\n";
}System.out.print("Usuario: Samm");
System.out.println("\nMedicamento\t"+"Cantidad\t"+"Monto
recuadado\t"+"Fecha\n");
System.out.print(ver+"\t\t"+ver3+"\n");
}
System.out.print("\n\n[s][n] Hacer otro reporte?:
");op4=lee.next();
}
RepoComp();
break;
case 2:
Home();
break;
default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");

RepoComp();
}
else if(op>2){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
RepoComp();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
RepoComp();
}
}
public void RepoVenUs(){
int op;
System.out.println("\n\n\t******** REPORTE: VENTAS DE USUARIO
********");
System.out.println("[1] Mostrar reporte compras");
System.out.println("[2] Regresar/Men-Home");
try{
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op4="s",ver3="",ver1="";
while(op4.equals("s")||op4.equals("S")){
if (DNI.length >= 1) {
System.out.print("Ingrese DNI: ");
camp=lee.next();ver="";
for (i = 0; i <= (DNI.length - 1); i++) {
ver = ver + Nombres[i]+"n";
ver1 = ver1 + NOMEDI[i]+"\n";
ver3 = ver3 + PRECUNI[i]+"\n";
if(DNI[i].equals(camp)){
System.out.print("Usuario: "+"Samm");
System.out.println("\nMes\t"+"Monto de
venta\t"+"Ao\n");
System.out.print(ver1+"\t\t"+ver3+"\n");
}
}
}else{
System.err.println("\nNo hay usuarios registrados!\n");
}
System.out.print("\n\n[s][n] Hacer otro reporte?:
");op4=lee.next();

}
RepoVenUs();
break;
case 2:
Home();
break;
default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
RepoVenUs();
}
else if(op>2){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
RepoVenUs();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
RepoVenUs();
}
}
public void RepoRankVen(){
int op;
System.out.println("\n\n\t******** REPORTE: RANKING DE VENTAS
********");
System.out.println("[1] Mostrar ranking ventas");
System.out.println("[2] Regresar/Men-Home");
try{
System.out.print("Ingrese opcion: ");
op=lee.nextInt();
switch(op){
case 1:
String op4="s",ver3="",ver1="";
while(op4.equals("s")||op4.equals("S")){
if (VENFEC.length >= 1) {
System.out.print("Ingrese fecha: ");
camp=lee.next();ver="";
for (i = 0; i <= (VENFEC.length - 1); i++) {
ver1 = ver1 + Nombres[i]+" "+Apellidos[i]+"\n";
ver3 = ver3 + PRECUNI[i]+"\n";
if(VENFEC[i].equals(camp)){
System.out.println("\nUsuarios\t"+"Monto de venta\n");
System.out.print(ver1+"\t\t"+ver3+"\n");

}
}
}
System.out.print("\n\n[s][n] Hacer otro reporte?:
");op4=lee.next();
}
RepoRankVen();
break;
case 2:
Home();
break;
default:
if(op<1){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
RepoRankVen();
}
else if(op>2){
System.err.println("**********************");
System.err.println("* Opcion incorrecta! *");
System.err.println("**********************");
RepoRankVen();
}
}
}
catch(Exception ex){
System.err.println("*********************");
System.err.println("* Ingreso invalido! *");
System.err.println("*********************");
RepoRankVen();
}
}
}

2.3 Manual de Uso


Primeramente el Administrador se tiene que logearse para para
poder acceder al Sistema

Luego se mostrara el men principal que el de cual deber de


seleccionar la opcin que necesite ingresado por teclado.

Si el usuario selecciona la opcin 1 se le mostrara un men que


permitir administrar usuarios del sistema.

Despus de seleccionar la opcin que requiera como registra


usuario deber ingresar por teclado el numero 1 como aparece
en el men
El usuario deber registrar los datos del nuevo usuario como el
DNI, Apellidos, Nombres, Usuario, Contrasea.

Luego de esto deber de ingresar S si quiere registra otro


usuario o N si quiere salir al men de administrar usuario de ah
tambin puede actualizar datos de usuario

Luego de seleccionar el cdigo del usuario que queramos


actualiza nos mostrara los diferentes campos que podamos
modificar.

De ah guardamos los cambios realizados

Nos llevara de nuevo al men de administracin de usuarios en


donde podemos eliminar el usuario

De ah nos regresara al men de administracin de usuario el


cual seleccionamos la opcin 4 para regresar al men principal

Ahora vamos a administrar tipos de medicamentos

Opcin 1 registrar tipo

Opcin 2 actualizar tipo

Opcin 3 eliminar tipo

Salimos al men principal y escogemos administrar formas de


presentacin de medicamentos

Opcin 1 registrar presentacin

Opcin 2 actualizar presentacin

Opcin 3 eliminar presentacin

Salimos al men principal y escogemos administrar


medicamentos

Opcin 1 registrar medicamento

Opcin 2 actualizar datos del medicamento


Opcin 3 eliminar medicamento

Salimos al men principal y escogemos administrar datos del


cliente

Opcin 1 registrar cliente

Opcin 2 actualizar datos del cliente

Opcin 3 actualizar puntos de bono

Opcin 4 eliminar usuario

Salimos al men principal y escogemos operaciones de venta

Opcin 1 registrar operaciones

III. Conclusiones

El siguiente sistema es una posible solucin para implementar


en una farmacia que requiera la utilidad de la siguiente
aplicacin creada en consola, que mediante mtodos,
condicionales simples dobles y estructuras selectivas.

IV. Bibliografa

Arreglos en java
http://aprenderaprogramar.com/index.php?
option=com_content&view=article&id=233:arrays-arreglosmultidimensionales-en-java-declaracion-y-uso-ejemplos-yejercicios-resueltos-cu00904c&catid=58:curso-lenguajeprogramacion-java-nivel-avanzado-i&Itemid=180

http://www.udb.edu.sv/udb/archivo/guia/informaticaingenieria/java-avanzado/2014/i/guia-4.pdf

Mtodos en java
http://pendientedemigracion.ucm.es/info/tecnomovil/documentos/f
java.pdf

También podría gustarte