DINO_CH

Untitled

Feb 8th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. package testbr;
  2. import java.util.*;//import java.util.Random
  3. public class newTest {//criando um code que dara o nome dos alunos com suas notas trimestrais
  4.  
  5.     public static void main(String[] args) {
  6.         String[]aluno={"Joao", "Marcelo", "Roberto", "Carmem" , "Maria"};//array alunos
  7.         String[] trimestre= {"1trim", "2trim","3trim","4trim"};//array trimestre
  8.         double[][]notas=new double [5][3];//array onde sera atribuido as notas
  9.        
  10.         Random num=new Random();//inicializando a classe Random
  11.        
  12.         for(int i=0;i<5;i++) {
  13.            
  14.             for(int j=0;j<3;j++) {
  15.                
  16.                 notas[i][j]=num.nextInt(11);
  17.                 if(notas[i][j]>=5 && notas[i][j]<=10) {
  18.             System.out.println((double)notas[i][j]);   
  19.                
  20.             }
  21.            
  22.             System.out.println("=========================== separaƧao ===========================");
  23.         }
  24.        
  25.     }
  26.        
  27.        
  28.        
  29.        
  30.        
  31.        
  32.  
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment