/*
  Grafico di una funzione usando solo testo
  (con funzione)
*/

class GraficoFunzione {
  static void linea(int n) {
    int i;

    for(i=1; i<=n; i=i+1) {
      System.out.print(" ");
    }
    System.out.println("*");
  }

  public static void main(String[] args) {
    double f;
    int x;

    for(x=-100; x<=100; x=x+1) {
      f=Math.abs(x)/20.0+20*Math.sin(x/10.0)+30;
      linea(Math.round((float) f));
    }
  }
}
