Ticket Prices Tutorial

From Progzoo
Jump to: navigation, search

Tickets for a show

public class P
{
  public static void main(String [] argv)
  {
    int [] ol = {1,0,0,1,2,4};
    for (int i=0;i<ol.length;i+=2)
    {
      System.out.printf("Adults:%d Children:%d\tCost:% 4d\n",
      ol[i],ol[i+1],cost(ol[i],ol[i+1]));
    }
  }
QcQ
}

Tickets cost £10 per adult and £6 per child.

[Font] [Default] [Show] [Resize] [History] [Profile]