Advertisement
cesarnascimento

grupos de 4 em ordem for incompleto

May 15th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. package ex22;
  2. import java.util.Scanner;
  3.  
  4. public class ex2 {
  5.  
  6.     public static void main(String[] args) {
  7.         int grupos,valores,v1,v2,v3,v4;
  8.         Scanner sc = new Scanner(System.in);
  9.        for(grupos = 0;grupos <=5;grupos++){
  10.        
  11.             for(valores = 1;valores <=4; valores++){
  12.  
  13.                 System.out.println("Digite o valor 1 do grupo "+grupos+": ");
  14.                 v1 = sc.nextInt();
  15.                 System.out.println("Digite o valor 2 do grupo: "+grupos+": ");
  16.                 v2=sc.nextInt();
  17.                 System.out.println("Digite o valor 3 do grupo: "+grupos+": ");
  18.                 v3=sc.nextInt();
  19.                 System.out.println("Digite o valor 4 do grupo: "+grupos+": ");
  20.                 v4=sc.nextInt();
  21.                 grupos++;
  22.             }
  23.            
  24.        }
  25.        
  26.  
  27.     }
  28.  
  29. }
  30.  
  31. // ler nome do cliente e o valor das compras do ano passado.
  32. // calcular e mostrar bonus de 10% se as compras forem menor que 1000 e maiores 15%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement