MCPcopy Index your code
hub / github.com/careercup/ctci / main

Method main

java/Chapter 8/Question8_4/Question.java:10–30  ·  view source on GitHub ↗

@param args

(String[] args)

Source from the content-addressed store, hash-verified

8 * @param args
9 */
10 public static void main(String[] args) {
11 ParkingLot lot = new ParkingLot();
12
13 Vehicle v = null;
14 while (v == null || lot.parkVehicle(v)) {
15 lot.print();
16 int r = AssortedMethods.randomIntInRange(0, 10);
17 if (r < 2) {
18 v = new Bus();
19 } else if (r < 4) {
20 v = new Motorcycle();
21 } else {
22 v = new Car();
23 }
24 System.out.print("\nParking a ");
25 v.print();
26 System.out.println("");
27 }
28 System.out.println("Parking Failed. Final state: ");
29 lot.print();
30 }
31
32}

Callers

nothing calls this directly

Calls 5

parkVehicleMethod · 0.95
printMethod · 0.95
randomIntInRangeMethod · 0.95
printMethod · 0.95
printMethod · 0.45

Tested by

no test coverage detected