//comments
/*comments*/
import java.util.Scanner;
 class Main{
  public static void main(String[] args){
   Scanner teclado = new Scanner(System.in);
   int producto, cantidad, total= 0, valor=0;
   int contador = 0,total1= 0;
   int mas=0, lbs=0;
    producto = teclado.nextInt();
    
    
    do{
    cantidad = teclado.nextInt();
    switch(producto){
        case 1: // mango 
        lbs =+ cantidad ;
            if (cantidad > 3 ){
             mas = 300;    
             valor = 500;
            } else {
            valor = 600;
            }break;
           
        case 2: // pina 
            if (cantidad > 3 ){
             mas = 900;
             valor = 1200;
            } else {
            valor = 1500;
            }break;
            
        case 3: // tamarindo  
            
            if (cantidad > 2 ){
             valor = 800;
             mas = 400;
            } else {
            valor = 1000;
            } break;
    }
    } while (producto < 0 && producto > 3 );
    
            total = valor * cantidad + mas;
            System.out.print(total+" "+ lbs);;
  }
}



Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: