Assignemnt #12 Variables and Names

Code

    /// Name: Drew Boxold
    /// Period: 5
    /// Program Name: 12
    /// File Name: VariablesAndNames
    /// Date Finished: 9/15/2015
    
    
    public class VariablesAndNames
    {
        public static void main( String[] args )
        {
            //all variable names
            int cars, drivers, passengers, cars_not_driven, cars_driven;
            double space_in_a_car, carpool_capacity, average_passengers_per_car;
    
            //# of cars
            cars = 100;
            //floating digit of # of people in each car
            space_in_a_car = 4.0;
            //# of drivers
            drivers = 30;
            //# of passengers
            passengers = 90;
            //shows number of cars not driven by subtracting cars by number of drivers
            cars_not_driven = cars - drivers;
            //shows number of cars driven by showing number of drivers
            cars_driven = drivers;
            //number of people availible for carpool by multiplying people by number of cars
            carpool_capacity = cars_driven * space_in_a_car;
            //finds average by dividing # of passengers by # of cars driven 
            average_passengers_per_car = passengers / cars_driven;
    
    
            System.out.println( "There are " + cars + " cars available." );
            System.out.println( "There are only " + drivers + " drivers available." );
            System.out.println( "There will be " + cars_not_driven + " empty cars today." );
            System.out.println( "We can transport " + carpool_capacity + " people today." );
            System.out.println( "We have " + passengers + " to carpool today." );
            System.out.println( "We need to put about " + average_passengers_per_car + " in each car." );
        }
    } 
    

Picture of the output

Assignment 12