Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.Formatter;
- import java.util.Random;
- import java.util.Scanner;
- public class Gen_Student {
- private Scanner input ;
- private String list ="";
- Random randomGenerator = new Random();
- private Formatter x;
- public void make(){
- try {
- x =new Formatter("list.txt");
- } catch (Exception e) {
- System.out.println(e);
- }
- }
- public void addToFile(String cv){
- x.format("%s %s", "20","goof");
- }
- public void ReadBoy(){
- try {
- input =new Scanner(new File("boy.txt"));
- } catch (Exception e) {
- System.out.println(e);
- }
- }
- public void ReadGirl(){
- try {
- input =new Scanner(new File("Girls.txt"));
- } catch (Exception e) {
- System.out.println(e);
- }
- }
- public void ReadLast(){
- try {
- input =new Scanner(new File("Last.txt"));
- } catch (Exception e) {
- System.out.println(e);
- }
- }
- public String Read(){
- while(input.hasNext()){
- list+=input.next()+"|";
- }
- return list;
- }
- public String[] spliter(String name){
- String[] list = name.toLowerCase().split("\\|");
- return list;
- }
- public String fullName(String[] Boy,String[] Girl,String[] Last){
- String firstName ;
- String sex ;
- int chance = randomGenerator.nextInt(100);
- if (chance <= 75) firstName = Boy[randomGenerator.nextInt(Boy.length)];
- else firstName = Girl[randomGenerator.nextInt(Girl.length)];
- String lastmane = Last[randomGenerator.nextInt(Last.length)];
- if(chance<=75) sex = "Male" ;
- else sex = "Female" ;
- return firstName+" "+lastmane+" "+sex;
- }
- public float GPU(){
- float gpu=((float)randomGenerator.nextInt(200)/100)+2;
- return gpu;
- }
- public String ficilaty(){
- int chance = randomGenerator.nextInt(100);
- if (chance <= 25) return "Network" ;
- else if(chance <= 85)return "Computer Scincse";
- else return "Ai";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement