Universidad Metropolitana
Aguadilla Puerto Rico
COSC 131
Solución de Problemas con
Estructuras Divisionales
Zulimar Acevedo Pérez
March 1, 2011
Prof. Juan Quintana
Preguntas de Discusión
1. ¿Cuáles son los tres tipos de decisión lógica?
The three types of logic are;
Linear Logic: All the conditions are evaluated, one by one, using a multiple decisional structure
Positive Logic: Positive logic always uses IF/THEN/ELSE. Using this logic you are telling the
computer to follow a series of instructions and to continue processing it if the condition is true.
IF it’s FALSE than the computer stops and processes a different decision,
Negative Logic: It is the same process that the Positive Logic does but the opposite. It is used
less than the positive logic, since we are not costumed to think in a negative manner.
Aplicación
1. Reproduce esta gráfica
Estructura condicional simple. Una sola condición
Algoritmo Flujograma
Simple conditional structure. Only One condition
Algorithm
IF HOURS >40
THEN
PAY = RATE * (40 + 2.5 * HOURS – 40)
T
ELSE
F PAY = RATE * HORAS
Simple conditional structure. Only One condition
Flow Chart
IF
Hours >40
Rate = RATE * HOURS PAY = RATE* (40
+2.5 *(Hours – 40)
B
4. Construye un algoritmo y flujo grama para calcular las notas de los estudiantes, dada la
siguiente escala:
Start
Read G
G<55 55<=g<60 60<=g<70 70<=g<80
Print “A”
Print “F” Print “D” Print “C” Print “B” STOP
Algoritmo Method
LetterGrade
Input: One Number
1. If(the number is between 90 and 100, inclusive)
then
1.1 Set the grade to “A”
End if
2. If (the number is between 80 and 89, inclusive)
then
2.1 Set the grade to “B”
End if
3. If (the number is between 70 and 79, inclusive)
then
3.1 set the grade to “C”
End if
4. If (the number is between 60 and 69, inclusive)
then
4.1 Set the grade to “D”
End if
5. If (the number is than 60)
Then
5.1 Set the grade to “F”
6. Return the grade
End
5. La Comisión
Ventas Comisión
< = 2500 .03
2501—3500 .04
3501—4500 .05
>4500 .15
=IF(H2<=2500,H2*0.3,IF(H2>2501,(0.4*(H2-2500))+3500,IF(H2>3501,(0.5*(H2-3501))+4500)))