Conditional

310 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
310
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Conditional

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

×