Advertisement
Guest User

eddie yer dum

a guest
Jun 28th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. import java.util.Random;
  2. public class Launcher {
  3.     static String name = "";
  4.     static String breed = "";
  5.     static int age = 0;
  6.     public static void main(String[] args) {
  7.         for (int l = 0; l <= 99; l++) {
  8.             Dog dog1 = new Dog();
  9.             System.out.println("Dog " + (l + 1) + ":");
  10.             Name();
  11.             dog1.name = name;
  12.             Breed();
  13.             dog1.breed = breed;
  14.             Age();
  15.             dog1.age = age;
  16.             dog1.printDog();
  17.             System.out.println("");}}
  18.     public static void Name() {
  19.         Random r = new Random();
  20.         String nameList = "abcdefghijklmnopqrstuvwxyz";
  21.         name = "";
  22.         for (int i = 0; i <= 10; i++) {
  23.             name += nameList.charAt(r.nextInt(nameList.length()));}}
  24.     public static void Breed() {
  25.         Random s = new Random();
  26.         String breedList = "qwertyuiopasdfghjklzxcvbnm";
  27.         breed = "";
  28.         for (int j = 0; j <= 10; j++) {
  29.             breed += breedList.charAt(s.nextInt(breedList.length())); }}
  30.     public static void Age() {
  31.         Random t = new Random();
  32.         age = t.nextInt(15);}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement