Question: I'm want to use client-side printing to print multiple documents but want some more control over the print functionality or print dialog. This is not possible in IE but I noticed that chrome browser has it own print dialog compared to the default windows print dialog.

Is there an API for the chrome print that I could use in JavaScript?

Answer: 
You can use the switch inside another switch. so the advantage of this is that if in future you want to expend/reuse that code again, then you will never insert new if-else condition again and again, along this the execution time will be faster as compare to use if-else block. You can further make the code simpler.

```
  Char ch=MyFunciton(); //get return value for condition
  switch(delieveryDay)
   {
     case NEXT_DAY:
        switch(ch)
         {
            case a:
               cost=25; 
               break;
            case b:
               cost = numberOfItems * 6.00;
               break;
            case c:
               cost = 35;
               break;
           case d:
               cost = numberOfItems * 7.50;
               break;
          }
       break;
     case IN_TWO_DAYS:
         switch(ch)
         {
            case a:
               cost = 10; 
               break;
            case b:
               cost = numberOfItems * 2.50;;
               break;
            case c:
               cost = 15;;
               break;
            case d: 
               cost = numberOfItems * 3.50;
                break;
          }
    break;
    case IN_A_WEEK:
       switch(ch)
         {
           case a:
                cost = numberOfItems * 1.50;
                break;
           case b:
                cost = 0;
                break;
           case c:
                cost = 10;
                break;
           case d:
                cost = numberOfItems * 2.50;
                break;
         }
  break;
  }

public char MyFunction() //this function will return character value for condition purpose there in switch
{
   if(purchaseAmount <= 100 && numberOfItems <= 3)
       return a;
   else if(purchaseAmount <= 100 && numberOfItems > 3)
       return b;
   else if(purchaseAmount > 100 && numberOfItems <= 3)
       return c;
   else if(purchaseAmount >100 && numberOfItems > 3)
       return d;
  }

```
I suggest you to store costs somewhere in database instead of not hard-coded. this will reduce your code to db connection and query.