package Pkg;

import java.util.Scanner;

public class Test {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        Scanner input2 = new Scanner(System.in);

        Parking[] parkingToday = new Parking[300];

        System.out.println("How many vehicles we have today ? (enter an integer no more than 300): ");

        int numberOfVehicules = 0;

        int type = 0;
        int hours = 0;

        double todayFees = 0;



        numberOfVehicules = input.nextInt();


        for (int i = 0; i < numberOfVehicules ; i++) {

            System.out.println("What is the type of vehicle? : (1-Car    2-Motorbike): ");
            while (!input.hasNextInt() ){
                System.out.println("Please enter an integer and nothing else");
                input.next();

            }

            type = input.nextInt();

            System.out.println("How many hours is it parked?: (enter an integer) ");
            while (!input.hasNextInt() ){
                System.out.println("Please enter an integer and nothing else");
                input.next();

            }

            hours = input.nextInt();

            parkingToday[i] = new Parking(type, hours);
        }



    }
}

@@ -152,57 +152,8 @@
 in);
-%0A        Scanner input2 = new Scanner(System.in);
 %0A%0A  
@@ -200,16 +200,106 @@
 ng%5B300%5D;
+ // we declare and create our array but notice that we didn't create objects inside it yet
 %0A%0A      
@@ -417,25 +417,24 @@
 umberOfVehic
-u
 les = 0;%0A%0A  
@@ -508,16 +508,165 @@
 s = 0;%0A%0A
+        while (!input.hasNextInt())%7B%0A            System.out.println(%22Please enter an integer and nothing else%22);%0A            input.next();%0A%0A        %7D
 %0A%0A      
@@ -676,25 +676,24 @@
 umberOfVehic
-u
 les = input.
@@ -746,17 +746,16 @@
 rOfVehic
-u
 les ; i+
@@ -758,18 +758,94 @@
 ; i++) %7B
-%0A%0A
+ // this is a loop to create the vehicles inside the array%0A%0A%0A            do%7B%0A 
         
@@ -840,32 +840,35 @@
 o%7B%0A             
+   
 System.out.print
@@ -926,24 +926,29 @@
 rbike): %22);%0A
+%0A    
             
@@ -965,33 +965,32 @@
 put.hasNextInt()
- 
 )%7B%0A             
@@ -984,32 +984,36 @@
                 
+ 
+   
 System.out.print
@@ -1033,39 +1033,34 @@
 ter 
-an integer and nothing else%22);%0A
+the numbers 1 or 2%22);%0A    
     
@@ -1090,34 +1090,37 @@
 );%0A%0A            
+    
 %7D
-%0A
 %0A            typ
@@ -1116,16 +1116,20 @@
         
+    
 type = i
@@ -1136,32 +1136,79 @@
 nput.nextInt();%0A
+            %7Dwhile (type != 1 && type != 2);%0A%0A%0A
 %0A            Sys
@@ -1550,16 +1550,280 @@
      %7D%0A%0A
+        for (int i = 0; i %3C numberOfVehicles; i++) %7B // this is a loop to calculate the fees of all the vehicles%0A%0A            todayFees = todayFees + parkingToday%5Bi%5D.getFees();%0A        %7D%0A%0A        System.out.println(%22The total fees for today are: %22 + todayFees);%0A%0A%0A
 %0A%0A    %7D%0A

update the last exercise