Documentos de Académico
Documentos de Profesional
Documentos de Cultura
• ALGORITMO.
Algoritmo calcula_operacion_de_un_circulo
Escribir 'INGRESE EL VALOR DE RADIO'
Leer r
ac <- pii*(r^2)
perim <- pii*(2*r)
LC <- perim/pii
FinAlgoritmo
1
• DIAGRAMA DE FLUJO.
• PROGRAMA.
#include<iostream>
#include<cmath>
using namespace std;
int main() {
float ac;
EL VALOR DE RADIO" << endl;
2
cin >> r;
ac = pii*(pow(r,2));
perim = pii*(2*r);
lc = perim/pii;
cout << " EL VALOR DEL AREA DEL CIRCULO ES " << ac << endl;
cout << " EL VALOR DEL PERIMIETRO DEL CIRCULO ES " << perim
<< endl;
cout << " EL VALOR DE LA LONGITUD DE LA CIRCUNFERENCIA
ES " << lc << endl;
return 0;
}
3
2. Escribe el pseudocódigo, diagrama de flujo y programa para
capturar un dato numérico entero, para después imprimirlos 5
primeros números enteros positivos y realizar las reglas de
negocio que se describen a continuación:
• ALGORITMO.
Algoritmo CALCULO_DE_OPERACIONES
Definir i,j,k,l,t1 Como Entero
Definir t Como Real
Escribir 'ELIGE LA OPERACION QUE DESEAS REALIZAR'
Escribir ' 1 SUMA '
Escribir ' 4 DIVISION'
Escribir ' 5 DIVISION DE LA MULTIPLICACION POR 3 '
Leer opc
Si opc<=0 O opc>=6 Entonces
4
Escribir 'INGRESA UN VALOR CORRECTO'
FinSi
Si opc=1 Entonces
Escribir 'PARA LA SUMA INGRESE 2 VALORES '
Leer j Leer k t <- j+k
Escribir ' EL RESULTADO DE SU SUMA ES: ',t
FinSi
Si opc=4 Entonces
Escribir 'PARA LA DIVISION INGRESE 2 VALORES '
Leer j Leer k t <- j/k
Escribir ' EL RESULTADO DE SU DIVISION ES: ',t
FinSi
Si opc=5 Entonces
Escribir 'PARA LA DIVISION DE LA MULTIPLICACION
INGRESE 2 VALORES '
Leer j
Leer k
t <- j*k
Escribir ' EL RESULTADO DE SU MULTIPLICACION ES: ',t,'
ENTRE 3'
t1 <- t/3
Escribir ' EL RESULTADO DE SU SUMA ES: ',t1
FinSi
i <- 1
FinAlgoritmo
5
• DIAGRAMA DE FLUJO.
• PROGRAMA.
//CALCULO MATEMATICO
#include<iostream>
using namespace std;
int main() {
int i;
int j;
int k;
int l;
float opc;
float t;
int t1;
6
cout << "ELIGE LA OPERACION QUE DESEAS REALIZAR" <<
endl;
cout << " 1 SUMA " << endl; cout << " 2 RESTA" << endl;
cout << " 3 MULTIPLICACION" << endl;
cout << " 4 DIVISION" << endl;
cout << " 5 DIVISION DE LA MULTIPLICACION POR 3 " <<
endl;
cin >> opc;
SU SUMA ES: " << t << endl;
}
if (opc==2) {
cout << "PARA LA RESTA INGRESE 2 VALORES " << endl;
cin >> j; cin >> k; t = j-k;
cout << " EL RESULTADO DE SU RESTA ES: " << t << endl;
}
if (opc==3) {
cout << "PARA LA MULTIPLICACION INGRESE 2 VALORES "
<< endl;
cin >> j; cin >> k; t = j*k;
cout << " EL RESULTADO DE SU MULTIPLICACION ES: " << t
<< endl;
}
if (opc==4) {
cout << "PARA LA DIVISION INGRESE 2 VALORES " << endl;
cin >> j;
cin >> k;
t = j/k
7
t1 = t/3;
cout << " EL RESULTADO DE SU SUMA ES: " << t1 << endl;
}
i = 1;
return 0;
}
8
3. Escribe el pseudocódigo, diagrama de flujo y programa que
realice las reglas de negocio que se describen a continuación:
Declare una variable entera x con valor 3 y una double y con valor 5.0
Calcule la expresión z = 200y + x.
Imprima el resultado como double, como entero y como byte, siendo z un
float
Para este ejercicio les recomiendo investigar acerca de las técnicas de
conversión de datos.
Adjuntar código fuente y pantallas que muestren la corrida del programa.
• ALGORITMO.
9
• DIAGRAMA DE FLUJO.
• PROGRAMA.
int main() {
double oy;
10
int x;
float z;
cout << "este es un programa para convertir los datos por
favor" << endl;
cout << "ingrese un valor para x" << endl;
cin >> x;
cout << "ingrese un vqalor para Y" << endl; cin >> oy;
z = (200*oy)+x;
cout << "segun la formula z=200*y+x" << endl;
cout << "el valor de z, como entero es: " << z << endl;
cout <<"el valor de z como double es:" <<z <<endl; return
0;
}
• ALGORITMO.
Algoritmo conversion_de_datos_valores fijo
Definir x, y1 Como Entero
Definir z Como real
Escribir "esta es la conversion de datos como
double, entero y byte";
x=3
y1=5
z <- (200*y1)+x
Escribir 'segun la formula z=200*y+x';
11
Escribir "cuando x=3, y=5.0";
Escribir 'el valor de z, como double es: ',z
Escribir 'el valor de z, como entero es: ',z
Escribir 'el valor de z, como byte es: ',z
FinAlgoritmo
• DIAGRAMA DE FLUJO.
12
• PROGRAMA.
13
• BIBLIOGRAFIA.
14