-
Notifications
You must be signed in to change notification settings - Fork 0
/
archivo-3.cst
93 lines (89 loc) · 2.46 KB
/
archivo-3.cst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
funcionesEspecialesYNativas(): void{
int a = 15;
Println("------------------TOLOWER-------------------");
Println("SIN TOLOWER");
Println(toLower("CON TOLOWER"));
Println("------------------TOUPPER-------------------");
Println("sin toupper");
Println(toUpper("con toupper"));
Println("------------------ROUND-------------------");
double c=26.5;
Println("sin round: "+c);
c=round(c);
Println("con round "+c);
double cc=26.4;
Println("sin round: "+cc);
cc=round(cc);
Println("con round "+cc);
Println("-----------------TYPEOF--------------------");
string x="soy una cadena";
int y = 50;
double z = 78.5;
char xx = 'a';
boolean yy = true;
Println("tipo: "+typeof(x));
Println("tipo: "+typeof(y));
Println("tipo: "+typeof(z));
Println("tipo: "+typeof(xx));
Println("tipo: "+typeof(yy));
Println("------------------LENGTH-------------------");
string cadena="soy una cadena";
Println("tamaño: "+length(cadena));
Println("------------------TOSTRING-------------------");
int numero=105;
Println("tipo: "+typeof(numero));
Println("tipo: "+typeof(toString(numero)));
Println("----------------TOCHARARRAY------------------");
char[] listaChar = toCharArray("SOY UNA LISTA");
Println("########imprimiendo lista de caracteres#######");
imprimirListaChar(listaChar);
}
RUN funcionesEspecialesYNativas();
imprimirListaChar(char[] miLista){
for (int i = 0; i < length(miLista); i++) {
Println("listaChar[" + i + "] = " + getValue(miLista,i));
}
}
getValue(char[] miLista, int index): char {
return miLista[index];
}
/*
--------------------SALIDA ESPERADA-----------------
------------------TOLOWER-------------------
SIN TOLOWER
con tolower
------------------TOUPPER-------------------
sin toupper
CON TOUPPER
------------------ROUND-------------------
sin round: 26.5
con round 27
sin round: 26.4
con round 26
-----------------TYPEOF--------------------
tipo: STRING
tipo: INT
tipo: DOUBLE
tipo: CHAR
tipo: BOOLEAN
------------------LENGTH-------------------
tamaño: 14
------------------TOSTRING-------------------
tipo: INT
tipo: STRING
----------------TOCHARARRAY------------------
########imprimiendo lista de caracteres#######
listaChar[0] = S
listaChar[1] = O
listaChar[2] = Y
listaChar[3] =
listaChar[4] = U
listaChar[5] = N
listaChar[6] = A
listaChar[7] =
listaChar[8] = L
listaChar[9] = I
listaChar[10] = S
listaChar[11] = T
listaChar[12] = A
*/