Created
May 24, 2013 14:58
-
-
Save gmfc/5644123 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import javax.swing.*; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| public class randd { | |
| public static void main(String []args){ | |
| double seed,Xi,Xf; | |
| double[] vetor; | |
| int t; | |
| do{ | |
| t = Integer.parseInt(JOptionPane.showInputDialog("Entre com o tamanho do vetor"));//Fazer método! | |
| }while(t<=0); | |
| vetor = new double[t]; | |
| } | |
| public static void leVetorInteiros (double v[ ],double ent){ | |
| for(int i =0;i < v.length;i++){ | |
| v[i] = entradaDouble(); | |
| } | |
| } | |
| public static void escreveVetor(double v[]){ | |
| String saida = ""; | |
| for(int i =0;i < v.length;i++){ | |
| saida = saida + v[i]+"\n"; | |
| } | |
| saida(saida); | |
| } | |
| public static void saida(String s){ | |
| JOptionPane.showMessageDialog(null, s); | |
| } | |
| public static double entradaDouble(){ | |
| double e; | |
| e = Double.parseDouble(JOptionPane.showInputDialog("Entre com número")); | |
| return e; | |
| } | |
| public static double prTermo(double Xi){ | |
| double Xf, | |
| a = 25136, | |
| b = 25256, | |
| m = 750000; | |
| Xf=(a*Xi+b)%m; | |
| return Xf; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment