1. FACULTAD DE INFORMÁTICA Y ELECTRÓNICA
CARRERA: INGENIERÍAEN ELECTRÓNICA Y AUTOMATIZACIÓN
MATERIA: PROGRAMACIÓN ESTRUCTURADA
NOMBRES Y CÓDIGOS:
Estiven Granizo 698
SEMESTRE Y PARALELO:Primero “B”
FECHA: 07/11/2020
TAREA
Tema: ESCRIBA AL LADO DERECHO LAS SENTENCIAS EN C++,QUE
REPRESENTEN EXACTAMENTE LO QUE INDICA EL DIAGRAMA DE FLUJO.
DIAGRAMA DE FLUJO DE CONTROL Y SENTENCIAS EN
C++
DIAGRAMA 1 SENTENCIA 1
If (Cal>8 )
Cout<<”Aprobado”;
DIAGRAMA 2 SENTENCIA 2
2. If (condicion 1)
{
Bloque 1;
}
Else
{
If(condicion 2)
{
Bloque 2;
}
Else
{
Bloque 3;
}
}
DIAGRAMA 3 SENTENCIA 3
If (Edad>=18)
Cout”es mayor de edad”;
DIAGRAMA 4 SENTENCIA 4
Quiero café;
if(¿hay café hecho?)
calentar café;
else
hacer café;
servir en taza y añadir azucar;
if (¿esta dulce?)
tomar café;
else
añadir azucar;
3. DIAGRAMA 5 SENTENCIA 5
If (A>B)
Cout<<”A es mayor que B”;
Else
{
If(A=B)
Cout<<”A es igual a B”;
Else
Cout<<” A es menor que B”;
}
4. DIAGRAMA 6 SENTENCIA 6
If (condicion1)
Instrucción 1;
Else
{
If (condicion 2)
Instrucción 2;
else
{
If (condicion 3)
Instrucción 3;
}
}
DIAGRAMA 7 SENTENCIA 7
If(A>B)
{
If(A>C)
{
If(B>C)
Cout<<A<<B<<C;
Else
Cout<<A<<C<<B;
}
Else
Cout<<C<<A<<B;
}
Else
{
If(B<C)
{
If(A>C)
Cout<<B<<A<<C;
5. Else
Cout<<C<<C<<A;
}
Else
Cout<<C<<B<<A;
}
DIAGRAMA 8 SENTENCIA 8
If (condicion1)
{
If (condicion 2)
{
Sentencias A;
}
Else
{
Sentencias B;
}
}
Else
{
Sentencias C;
}
DIAGRAMA 9 SENTENCIA 9
If(numero>6)
Cout<<”Aprobo la materia”;
Else
Cout<<”No aprobo la materia”;
If (numero>=8)
Cout<<”Puede ganar una beca”;
DIAGRAMA 10 SENTENCIA 10
6. If(modo por tiempo seleccionado)
{
Dar orden de encender motor;
Encender motor;
Dar orden de apagar motor;
Apagar motor;
}
Else
{
If(funcionamiento inicio)
{
Encender el motor;
Generar retardo con el tiempo
ingresado;
Apagar el motor;
}
}