Paper
JHONATAN OSORIO IDARRAGA
COMPILADORES
PRINCIPIOS, TECNICAS Y HERRAMIENTAS
1. Realizar un programa en java que llene un ventor de 10 posiciones y las imprima(consola).
public class vector {
public static void main (String Arg[])throws IOException{
BufferedReader in = new BufferedReader(new
InputStreamReader (System.in));
intarray[]=new int [10];
int i=0;
int dato;
for(i=0; i<10; i++){
System.out.print("Ingrese numero: ");
dato = Integer.parseInt(in.readLine( ));
array[i]=dato;
}
for (intj=0; j<10; j++){
System.out.println(array[j]);
}
}
}
TABLA DE SIMBOLOS
Tabla de operadores:
Operador | tipo |
Asignación | = |
Menor | < |
incremento | i++ |
Tabla depalabras reservadas:
Palabra reservada | tipo |
Class | Clase |
Public | Publico |
static | static |
void | vacio |
throws | trocadas |
new | nuevo |
int | numérico |
for | para |system | sistema |
out | salir |
println | imprimir |
main | principal |
string | alfabetico |
arg | Argumento |
IOException | Error de E/S |
BufferedReader | Leer en el tope |InputStreamReader | leer |
Tabla de identificadores:
Identificador | tipo |
{ | Símbolo |
( | Símbolo |
[ | Símbolo |
. | Símbolo |
; | Símbolo |
] | símbolo |
) | Símbolo |
} |símbolo |
Tabla de Variables:
Variable | Tipo | Valor |
i | Int | 0 |
j | Int | 0 |
dato | Int | 0 |
array | vector | 10 |
2. Realizar un programa en Visual Studio .net que resuelvael problema del teorema de Pitágoras (consola).
Module Module1
Sub Main()
Dim h As Double
Dim c As Double
Dim a As Double
c = Console.ReadLine()
a= Console.ReadLine()
h = Math.Sqrt(Math.Pow(c, 2) + Math.Pow(a, 2))
Console.WriteLine(h)
End Sub
End Module
TABLA DE SIMBOLOS
Tabla de operadores:
Operador | tipo |...
Regístrate para leer el documento completo.