MasCiclosDibujos

MasCiclosDibujos - public static void zxy(){ for(char...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*;  import java.util.*;  public class MasCiclosDibujos{    public static Scanner teclado = new Scanner(System.in);    public static void dibujaCuadrado(int n){  for(int ren=1; ren<=n; ren++){  for(int col=1; col<=n; col++){  System.out.print("*");}  System.out.println();}}    public static void escaleraAsterisco(int n){  for(int ren=1; ren<=n; ren++){  for(int col=1; col<ren; col++){  System.out.print("*");}  System.out.println();}}  public static void escaleraNumero(int n){  for(int ren=1; ren<=n; ren++){  for(int col=1; col<ren; col++){  System.out.print(col);}  System.out.println();}}    public static void escaleraNumeroI(int n){  for(int i=1; i<=n; i++){  for(int j=1; j<=(n-i+1); j++){  System.out.print(j);}  System.out.println();}}  public static void picoDeNumeros(int n){ 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
escaleraNumero(n);  escaleraNumeroI(n);  System.out.println();} 
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public static void zxy(){ for(char u='Z'; u&gt;='A'; u--){ for(char i=u; i&gt;='A'; i--){ System.out.print(i);} System.out.println();}} public static void fer(int n){ for(int i=1;i&lt;=n;i++){ for(int u=n;u&lt;=n;u--){ if(u==n) System.out.print(u); else System.out.print(i);} System.out.println();}} public static void main(String args){ int n; String user = &quot;&quot;; do{ System.out.print(&quot;Ingrese el valor de n (positivo): &quot;); n = teclado.nextInt(); System.out.println(); dibujaCuadrado(n); escaleraAsterisco(n); escaleraNumero(n); System.out.println(); escaleraNumeroI(n); picoDeNumeros(n); System.out.println(); zxy(); fer(n); System.out.println(&quot;\n\nDesea continuar?&quot;); user = teclado.next(); }while(user.toLowerCase().equals(&quot;si&quot;)); } }...
View Full Document

This note was uploaded on 10/29/2009 for the course ITC TC-1002 taught by Professor X during the Spring '09 term at ITESM.

Page1 / 3

MasCiclosDibujos - public static void zxy(){ for(char...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online