Advertisement
Dexter2016

NameGen 0.3

May 7th, 2014
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.95 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.Formatter;
  3. import java.util.Random;
  4. import java.util.Scanner;
  5.  
  6.  
  7. public class Gen_Student {
  8.  
  9.     private Scanner input ;
  10.     private String list ="";
  11.     Random randomGenerator = new Random();
  12.     private Formatter x;
  13.    
  14.     public void make(){
  15.         try {
  16.              x =new Formatter("list.txt");
  17.         } catch (Exception e) {
  18.             System.out.println(e);
  19.         }
  20.     }
  21.    
  22.     public void addToFile(String cv){
  23.         x.format("%s %s", "20","goof");
  24.     }
  25.    
  26.    
  27.  
  28.     public void ReadBoy(){
  29.         try {
  30.             input =new Scanner(new File("boy.txt"));
  31.         } catch (Exception e) {
  32.             System.out.println(e);
  33.         }
  34.     }
  35.    
  36.     public void ReadGirl(){
  37.         try {
  38.             input =new Scanner(new File("Girls.txt"));
  39.         } catch (Exception e) {
  40.             System.out.println(e);
  41.         }
  42.     }
  43.    
  44.     public void ReadLast(){
  45.         try {
  46.             input =new Scanner(new File("Last.txt"));
  47.         } catch (Exception e) {
  48.             System.out.println(e);
  49.         }
  50.     }
  51.     public String Read(){
  52.        
  53.         while(input.hasNext()){
  54.             list+=input.next()+"|";
  55.         }
  56.         return list;
  57.     }
  58.    
  59.    
  60.     public String[] spliter(String name){
  61.         String[] list = name.toLowerCase().split("\\|");
  62.         return list;
  63.        
  64.     }
  65.    
  66.     public String fullName(String[] Boy,String[] Girl,String[] Last){
  67.        
  68.         String firstName ; 
  69.         String sex ;
  70.  
  71.         int chance = randomGenerator.nextInt(100);
  72.         if (chance <= 75) firstName = Boy[randomGenerator.nextInt(Boy.length)];
  73.         else    firstName = Girl[randomGenerator.nextInt(Girl.length)];
  74.         String lastmane  = Last[randomGenerator.nextInt(Last.length)];
  75.  
  76.         if(chance<=75)  sex = "Male" ;
  77.         else  sex = "Female" ;
  78.         return firstName+" "+lastmane+" "+sex;
  79.        
  80.        
  81.     }
  82.     public float GPU(){
  83.         float gpu=((float)randomGenerator.nextInt(200)/100)+2;
  84.        
  85.         return   gpu;
  86.        
  87.     }
  88.     public String ficilaty(){
  89.        
  90.     int chance = randomGenerator.nextInt(100);
  91.     if (chance <= 25) return "Network" ;
  92.     else if(chance <= 85)return "Computer Scincse";
  93.     else return "Ai";
  94.     }
  95.    
  96.    
  97.  
  98.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement