<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import java.util.Date;


/**
 * An application that uses the PhoneCard class
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class Driver
{
    /**
     * The entry point of the application
     *
     * @param args  The command-line arguments
     */
    public static void main(String[] args)
    {
       Date             end, now, start;       
       long             availableMillis;       
       PhoneCard        card;
       

       now   = new Date();
       card  = new PhoneCard(10.00, 2, 0.10);
       start = new Date(now.getTime());       
       end   = new Date(start.getTime() + 600000);

       // Get the status of the card
       availableMillis = card.getAvailableMilliseconds();       
       
       // Make a call if possible
       if (availableMillis &gt; 0)
       {
          card.startCall("540-568-1671", start);
          card.endCall(end);
       }
       
       
       // Get the status of the card
       availableMillis = card.getAvailableMilliseconds();       
		 
       // Make a call if possible
       if (availableMillis &gt; 0)
       {
          start = new Date(end.getTime() + 1200000);       
          card.startCall("540-568-1667", start);
          end   = new Date(start.getTime() + 2400000);
          card.endCall(end);
       }

       
       // Get the status of the card
       availableMillis = card.getAvailableMilliseconds();       
		 
       // Make a call if possible
       if (availableMillis &gt; 0)
       {
          start = new Date(end.getTime() + 60000);       
          card.startCall("540-568-8771", start);
          end   = new Date(start.getTime() + 90000);
          card.endCall(end);
       }
    }
    
}
</pre></body></html>