Assignemnt 12 and Variables And Names

Code

    /// Name: Xinting Chen
    /// Period: 5
    /// Program Name: Variables And Names
    /// File Name: VariablesAndNames.java
    /// Date Finished: 9/17/2015
  
    public class VariablesAndNames
    {
        public static void main( String[] args )
        {
            int cars, drivers, passengers, cars_not_driven, cars_driven;
            double space_in_a_car, carpool_capacity, average_passengers_per_car;
            //This indicates that there are 100 cars, which later referred t0 30 replacing the word car.
            cars = 100;
            //This line indicates that the variable space in a car is 4. It is not neccessory to type 4.0, because it is not           showing on the output.
            space_in_a_car = 4;
            //This sets drivers to equal to 30.
            drivers = 30;
            //This sets passengers to equal to 90.
            passengers = 90;
            //car_not_drive is equal to car-drives.
            cars_not_driven = cars - drivers;
            //cars_driven is equal to drivers.
            cars_driven = drivers;
            //carpool_capacity is calculated as cars_driven times space_in_a_car.
            carpool_capacity = cars_driven * space_in_a_car;
            //the average_per_car is calvulated as passengers(90) divided by cars_driven,which is also refer to as         
            //drivers(30).    
            average_passengers_per_car = passengers / cars_driven;
            
            //The output of this line is the things in quotation mark. cars which is not in quotation mark is represented as           number 100, because it is equal to 100 shown above.
            System.out.println( "There are " + cars + " cars available." );
            //The outputs of this line are things in quotation mark and teh number of drivers referred above.
            System.out.println( "There are only " + drivers + " drivers available." );
            //The outputs of this line are things in quotation mark and the number of cars_not_driven shown above.
            System.out.println( "There will be " + cars_not_driven + " empty cars today." );
            //The outputs of this line are things in quotatio mark and the number of carpool_capacity shown above.
            System.out.println( "We can transport " + carpool_capacity + " people today." );
            //The outputs of this line are things in quotation mark and the number of passengers shown above.
            System.out.println( "We have " + passengers + " to carpool today." );
            //The outputs of this line are things in quotation mark and the number of average_passengers_per_car shown above.
            System.out.println( "We need to put about " + average_passengers_per_car + " in each car." );
        }
    }
    

Picture of the output

Assignment 12