Exámenes - Dibujo 2

En este ejercicio se debe crear un programa que pida un tamaño en píxeles (entre 40 y 80) y un color y muestre un dibujo SVG que incluye un círculo del tamaño y color elegidos.

Dibujo 2 - Comentarios

Dibujo 2 - Ejemplo de código HTML

  <p>
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg"
         width="240" height="240" viewBox="0 0 240 240">
      <polygon points="120,0 240,120 120,240 0,120" fill="red" />
      <rect x="60" y="60" width="120" height="120" fill="white" />
      <circle cx="120" cy="120" r="60" fill="red" />
    </svg>
  </p>
  <p>
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg"
         width="320" height="320" viewBox="0 0 320 320">
      <polygon points="160,0 320,160 160,320 0,160" fill="red" />
      <rect x="80" y="80" width="160" height="160" fill="white" />
      <circle cx="160" cy="160" r="80" fill="red" />
    </svg>
  </p>