Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1. import java.util.Random;
  2. import java.util.UUID;
  3.  
  4. public class GeneratorFlat {
  5.  
  6.   public static void main(String[] args) {
  7.     {
  8.       ArrayDeque<Flat> test = new ArrayDeque<>();
  9.     String name = null;
  10.     int year = 2000;
  11.     int id = 0;
  12.     double x = 45;
  13.     float y = 45;
  14.     int area = 0;
  15.     double c = Math.random();
  16.     double g = Math.random();
  17.     String HouseName = null;
  18.     Long numberOfRooms = null;
  19.     long numberOfFloors = 1;
  20.     Integer numberOfLifts = 1;
  21.     java.time.LocalDateTime creationDate = null;
  22.     Coordinates coordinates = new Coordinates(x,y);
  23.     Boolean furniture = null;
  24.     Boolean centralHeating = null;
  25.     House house = new House(HouseName,year,numberOfFloors,numberOfLifts);
  26.     Furnish furnish = Furnish.DESIGNER;
  27.     for(int i = 0;i < 10; i ++){
  28.       Flat a = new Flat(id,name,coordinates,creationDate,area,numberOfRooms,furniture,centralHeating,furnish,house);
  29.       test.addFirst(a);
  30.       for (int j = 0; j < 10; j ++){
  31.         x = x + 5;
  32.         y = y + 3;
  33.         area = area + 15;
  34.         numberOfRooms ++;
  35.         numberOfFloors ++;
  36.         numberOfLifts ++;
  37.         id ++;
  38.         year ++;
  39.         creationDate = LocalDateTime.now();
  40.         if (c > 0.5){
  41.           furniture = true;
  42.         } else furniture = false;
  43.         if (g > 0.5){
  44.           centralHeating = true;
  45.         } else centralHeating = false;
  46.  
  47.     }
  48.  
  49.       }
  50.     }
  51.  
  52. }
  53.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement