/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ejercicio_mj_prueba01;
import java.util.Scanner;
/**
*
* @author CFP31-26
*/
public class Ejercicio_mj_prueba01 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int sexo,acumulado=0,i,importe, servicio;
int corteMujer=300,corteHombre=200,peinado=600,brishing=250,color=500,afeitar=100;
//sexo: el genero del cliente//acumulado el total de la suma de los clientes//importe:el pago de cada cliente//i=contador
Scanner entrada = new Scanner (System.in);
System.out.println("Incluya el genero del Cliente 0=salir, 1=hombre, 2=mujer");
sexo=entrada.nextInt();
switch (sexo){
case 1:
System.out.println("Ingrese el servicio que desea 1 para corto, 2 para afeitado");
servicio = entrada.nextInt();
//importe=entrada.nextInt(); ***El importe no lo decide el usuario
do{
switch(servicio){ //Los valores se suman aquí, no están en variables
case 1:
acumulado=acumulado+200;
break;
case 2:
acumulado=acumulado+100;
break;
}
}
-----------------------
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ejercicio_cortes_de_pelo;
import java.util.Scanner;
/**
*
* @author MedinaDiaz
*/
public class Ejercicio_cortes_de_pelo {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
//-----------------variables------------------------
int sexo,acumulado=0,i,importe, servicio=0,servicio2=0;
int corteMujer=300,corteHombre=200,peinado=600,brishing=250,color=500,afeitar=100;
//sexo: el genero del cliente//acumulado el total de la suma de los clientes//importe:el pago de cada cliente//i=contador
//----------------------------------------
Scanner entrada = new Scanner (System.in);
//do
System.out.println("Incluya el genero del Cliente 0=salir, 1=hombre, 2=mujer");
sexo=entrada.nextInt();
System.out.println("Ingrese el servicio que desea.");
switch (sexo){
case 1:
System.out.println("servicio para hombre");
System.out.println("corte");
System.out.println("afeitar");
servicio = entrada.nextInt();
switch(servicio){
case 1:;
acumulado=acumulado+corteHombre;
break;
case 2:;
acumulado=acumulado+afeitar;
break;
}
case 2:
//case 1:
System.out.println("servicio para mujer");
System.out.println("corte");
System.out.println("peinado");
System.out.println("brishing");
System.out.println("color");
servicio2 = entrada.nextInt();
switch(servicio2){
case 1:;
acumulado=acumulado+corteMujer;
break;
case 2:;
acumulado=acumulado+peinado;
break;
case 3:;
acumulado=acumulado+brishing;
break;
case 4:;
acumulado=acumulado+color;
break;
default:;
break;
}
}
}
}
No hay comentarios:
Publicar un comentario