Exámenes - Dibujo 1

En este ejercicio se debe crear un programa que pida un tamaño en píxeles (entre 50 y 75) y un color y muestre un dibujo SVG con cinco cuadrados del tamaño y color elegidos.

Dibujo 1 - Comentarios

Dibujo 1 - Ejemplo de código HTML

  <p>
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg"
         width="180" height="180" viewBox="0 0 180 180">
      <rect fill="green" x="0" y="0" width="60" height="60" />
      <rect fill="green" x="60" y="60" width="60" height="60" />
      <rect fill="green" x="120" y="0" width="60" height="60" />
      <rect fill="green" x="0" y="120" width="60" height="60" />
      <rect fill="green" x="120" y="120" width="60" height="60" />
    </svg>
  </p>
  <p>
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg"
         width="240" height="240" viewBox="0 0 240 240">
      <rect fill="red" x="0" y="0" width="80" height="80" />
      <rect fill="red" x="80" y="80" width="80" height="80" />
      <rect fill="red" x="160" y="0" width="80" height="80" />
      <rect fill="red" x="0" y="160" width="80" height="80" />
      <rect fill="red" x="160" y="160" width="80" height="80" />
    </svg>
  </p>