Skip to content

Instantly share code, notes, and snippets.

@gmfc
Created May 24, 2013 14:58
Show Gist options
  • Select an option

  • Save gmfc/5644123 to your computer and use it in GitHub Desktop.

Select an option

Save gmfc/5644123 to your computer and use it in GitHub Desktop.
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