Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class Launcher {
- static String name = "";
- static String breed = "";
- static int age = 0;
- public static void main(String[] args) {
- for (int l = 0; l <= 99; l++) {
- Dog dog1 = new Dog();
- System.out.println("Dog " + (l + 1) + ":");
- Name();
- dog1.name = name;
- Breed();
- dog1.breed = breed;
- Age();
- dog1.age = age;
- dog1.printDog();
- System.out.println("");}}
- public static void Name() {
- Random r = new Random();
- String nameList = "abcdefghijklmnopqrstuvwxyz";
- name = "";
- for (int i = 0; i <= 10; i++) {
- name += nameList.charAt(r.nextInt(nameList.length()));}}
- public static void Breed() {
- Random s = new Random();
- String breedList = "qwertyuiopasdfghjklzxcvbnm";
- breed = "";
- for (int j = 0; j <= 10; j++) {
- breed += breedList.charAt(s.nextInt(breedList.length())); }}
- public static void Age() {
- Random t = new Random();
- age = t.nextInt(15);}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement