Escolar Documentos
Profissional Documentos
Cultura Documentos
DEFINICIÓN DE E/S:
impuestos (Impuesto)
Intereses
PSEUDOCODIGO:
definir constantes:
inicio
Impuesto= Mcompra*pimp
‘1’: inicio
pinteres = pint1
pcuotaini = pcin1
Nletras = nlet1
fin
‘2’: inicio
pinteres = pint2
pcuotaini = pcin2
Nletras = nlet2
fin
‘3’: inicio
pinteres = pint3
pcuotaini = pcin3
Nletras = nlet3
fin
mostrar resultados:
fin
DIAGRAMA DE FLUJO:
Inicio
1
pint1= 0.05
Interes= Mfactura * pinteres
pint2= 0.10
Nuevo_Mfactura= Mfactura + Interes
pint3= 0.15
Mcuotaini= Nuevo_Mfactura * pcuotaini
pcin1= 0.60
Mletra = (Nuevo_Mfactura – Mcuotaini)/Nletras
pcin2= 0.50
pcin3= 0.35
nlet1= 2
Escribir Mcompra,
nlet2= 4
Impuesto,Mfactura, Intereses,
nlet3= 6
pimp= 0.10 Nuevo_Mfactura,
Mcuotaini,Mletra,Nletra,Tipo_F
in
Ingresar
Mcompra,
Tipo_Fin Fin
Impuesto =Mcompra*pimp
Tipo_F
in
‘1’
pinteres = pint1
pcuotaini = pcin1
Nletras = nlet1
‘2’
pinteres = pint2
pcuotaini = pcin2
Nletras = nlet2
‘3’
pinteres = pint3
pcuotaini = pcin3
Nletras = nlet3
1
6.
Pseudocódigo:
alternativa_1 : Acción_1
alternativa_2 : Acción_2
alternativa_3 : Acción_3
alternativa_n : Acción_n
Acción_X
SELECTOR
ALTERNATIVA 1 ACCION 1
ALTERNATIVA 2 ACCION 2
ALTERNATIVA 3 ACCION 3
ALTERNATIVA N ACCION N
FIN
8.
CODIGO DE PROGRAMACION
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("MAÑANA")
ComboBox1.Items.Add("TARDE")
ComboBox1.Items.Add("NOCHE")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim TH, S, D, SN, HT As Double
Try
HT = Convert.ToDouble(Me.TextBox1.Text)
If ComboBox1.Text = "MAÑANA" Then
TH = 3.5
Else
If ComboBox1.Text = "TARDE" Then
TH = 4.5
Else
If ComboBox1.Text = "NOCHE" Then
TH = 5
End If
End If
End If
S = HT * TH
If S > 200 Then
D = S * 0.2
Else
If S >= 100 Then
D = S * 0.15
End If
End If
SN = S - D
TextBox2.Text = SN
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class
Inicio
HT, TURNO
TURNO
=MAÑANA
TH = 3.5
TURNO =
TARDE
TH = 4.5 TH = 5
S = HT*TH
S>200
D = S*0.2 S>200
D = S*0.15
SN = S - D
SN
Fin
9.
CODIGO DE PROGRAMACION
Public Class Form2
Dim d, tc, tp, n As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
tc = Val(TextBox1.Text)
If TextBox4.Text < 100 Then
d = tc * 0.2
Else
d = tc * 0.4
End If
tp = tc - d
TextBox2.Text = d
TextBox3.Text = tp
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
n = Rnd() * 200
TextBox4.Text = n
End Sub
End Class
Inicio
TC
Generar número = n
S>200
D = TC*0.2 D = TC*0.4
TP = TC - D
D, TP
Fin
10.
En c++
#include<iostream>
// Para leer variables de texto se utiliza el operador << del objeto cin, que
// lee solo una palabra. Para leer una linea completa (es decir, incluyendo los
int main() {
float matricula;
float n1;
float n2;
float n3;
float n4;
float prom;
float total;
cout << "digite las 4 ultimas notas de las materias" << endl;
prom = (n1+n2+n3+n4)/4;
if (prom>=18) {
total = matricula-matricula*0.4;
} else {
total = matricula+(matricula*0.19);
}
cout << "el valor a pagar es de" << total << endl;
return 0;
PSEUDOCODIGO:
Algoritmo sin_titulo
Leer matricula;
prom=(n1+n2+n3+n4)/4;
si prom>=18 Entonces
total=matricula-matricula*0.4;
SiNo
total=matricula+(matricula*0.19);
FinSi
FinAlgoritmo
12.
Pseudocodigo en PSeInt:
Diagrama de Flujo:
Código C++:
13.
Código c++
#include<stdio.h>
#include<conio.h>
main()
{
int e_c;
int can_pago=0,ed,c_h;
printf("ingrese cantidad de hijos");
scanf("%d",&c_h);
printf("ingrese estado civil de la madre(1=viuda 2=casada):");
scanf("%s",&e_c);
for (int c=1;c<=c_h;c++)
{
printf("ingrese edad del hijos");
scanf("%d",&ed);
if(ed>=6 && ed<=18)
{
can_pago=can_pago+10;
}
}
if(c_h<=2)
{
can_pago=can_pago+70;
}
else
{
if(c_h<=5)
{
can_pago=can_pago+90;
}
else
{
can_pago=can_pago+120;
}
}
if(e_c==1)
{
can_pago=can_pago+20;
}
printf("el monto a pagar es:%d", can_pago);
getch ();
}