You are on page 1of 4

Ejemplo:

1.- Para Sumar 2 Nmeros Cuales quiera


TextWindow.Write("escribe un numero:") numero1=textwindow.Read() TextWindow.Write("Escribe Otro numero:") numero2=textwindow.Read() suma=numero1+numero2 TextWindow.Write("resultado de la suma es: ") TextWindow.Write(suma)

Ejemplo:

2.- Para obtener el promedio de 5 calificaciones


TextWindow.Write("Escribe Una Calificacion") a=textwindow.Read() TextWindow.Write("Escribe Otra") b=textwindow.Read() TextWindow.Write("Escribe Otra") c=textwindow.Read() TextWindow.Write("Escribe Otra") d=textwindow.Read() TextWindow.Write("Escribe Otra") e=textwindow.Read() cal=(a+b+c+d+e)/5 TextWindow.Write("La calificacion es: ") TextWindow.Write(cal)

Practicas Small Basic

Ejemplo:

3.- Para saber si un nmero es negativo o positivo.


TextWindow.Write("Escribe Un Numero") a=textwindow.Read() If (a>0) Then TextWindow.Write("positivo") Else TextWindow.Write("negativo") EndIf

Ejemplo:

4.- Para saber que da de la semana es.


TextWindow.Write("Escribe el Numero de un dia") d=textwindow.Read() If (d=1) Then TextWindow.Write("Lunes") Else If (d=2) Then TextWindow.Write("Martes") Else If (d=3) Then TextWindow.Write("Miercoles") Else If (d=4) Then TextWindow.Write("jueves") Else If (d=5) Then TextWindow.Write("Viernes") Else TextWindow.Write("no es Dia Habil") EndIf EndIf EndIf EndIf EndIf

Practicas Small Basic

Ejemplo

5.- para sacar rea y permetro.


TextWindow.Write("Escribe Radio") r=textwindow.Read() area=3.1416*r*r TextWindow.Write("El Area es: ") TextWindow.Write(area ) perimetro=3.1416*(r+r) TextWindow.Write("El perimetro es: ") TextWindow.Write(perimetro)

Practicas Small Basic

You might also like