Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# Conditional

201

Published on

Published in: Education
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
201
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
1
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. ComputerProgram
Lic. Catalina Arambula
• 2. int L, R;
Console.writeline (“Captura un valor del lador de un rectanguloparamostrarte el perimetro”);
L=console.redline ();
R=L*L;
Console.writeline (“El perimetroes: “, R);
Console C #
• 3. Int L, r;
L=convert.toInt(textbox1.text);
r=L*L*L*L;
Textbox2.text=r;
Lineal
• 4. CONDITIONAL
• 5. Simple Conditional(Ifthen)
Condition
T
Action 1
F
• 6. If the student had 10 average, then, obtain diploma.
Simple conditional
Start
Average
Average=
10
T
Diploma
F
End
• 7. CASE (SELECTOR MÚLTIPLE)
1
4
Selector
2
3
Action 1
:
Action N
Action 1
:
Action N
Action 1
:
Action N
Action 1
:
Action N
• 8. CASE (SELECTOR MÚLTIPLE)
1
4
Selector
2
3
T= a + b
T= a / b
T= a - b
T= a * b
T
• 9. Start
Type two values
START
SHOW “Type a mathematical operator to selection: + for addition, / for divisions, - for subtraction and * for multiplication.”
CASE 1 DO T= a + b
CASE 2 DO T= a / b
CASE 3 DO T= a - b
CASE 4 DO T= a * b
END CASE
SHOW T
END
a, b
+
*
Selector
Type a mathematical operator to select: + for addition, / for division, - for subtraction, * for multiplication
-
/
T= a + b
T= a / b
T= a - b
T= a * b
T
End
• 10. Enter a value:
Enter b value:
Enter a symbol to select a operation
/ division
- subtraction
* multiplication
Total
• 11. Switch (selector)
{
CASE * : T=a+b;
Messagbox.Show ( “Total: “ T );
Break;
CASE /: T=a/b;
Messagbox.Show( “Total: “ T );
Break;
CASE - : T=a-b;
Messagbox.Show( “Total: “ T );
Break;
CASE * : T=a*b;
Messagbox.Show( “Total: “ T );
Break;
Default:
Messagbox.Show(“options invalid”);
Break;
}
• Double a, b, T ;
• 12. String selector;
• 13. a= convert. ToDouble (textbox1.Text);
• 14. b=convert.ToDouble(Textbox2.Text);
• 15. Selector=TextBox3.Text);