Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package piezas_aptas;
- import java.util.Scanner;
- public class Piezas_aptas {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- int x=1, cantidad=0, n;
- float largo;
- System.out.println("Cuantas piecas procesara?");
- n=keyboard.nextInt();
- while (x<=n) {
- System.out.println("Ingrese la medida de la pieza:");
- largo=keyboard.nextInt();
- if (largo>= 1.20 && largo <= 1.30){
- cantidad = cantidad + 1;
- }
- x = x +1;
- }
- System.out.printf("La cantidad de piezas aptas son: %d\n", cantidad);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment