conditional
TRANSCRIPT
![Page 1: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/1.jpg)
Computer ProgramLic. Catalina Arambula
![Page 2: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/2.jpg)
int L, R; Console.writeline (“Captura un valor del
lador de un rectangulo para mostrarte el perimetro”);
L=console.redline (); R=L*L; Console.writeline (“El perimetro es: “, R);
Console C #
![Page 3: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/3.jpg)
Int L, r; L=convert.toInt(textbox1.text); r=L*L*L*L; Textbox2.text=r;
Lineal
![Page 4: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/4.jpg)
CONDITIONAL
![Page 5: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/5.jpg)
Simple Conditional(If then)
Condition
T
FAction 1
![Page 6: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/6.jpg)
If the student had 10 average, then, obtain diploma.
Simple conditional
Start
Average
Average =
10
Diploma
End
T
F
![Page 7: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/7.jpg)
CASE (SELECTOR MÚLTIPLE)
Selector
Action 1:
Action N
Action 1:
Action N
Action 1:
Action N
Action 1:
Action N
1
2 3
4
![Page 8: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/8.jpg)
CASE (SELECTOR MÚLTIPLE)
Selector
T= a + b T= a / b T= a - b T= a * b
1
2 3
4
T
![Page 9: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/9.jpg)
Selector
T= a + b
T= a / b
T= a - b
T= a * b
+/ -
*
T
Start
a, b
Type two
values
Type a mathematical operator to select: + for addition, / for division, -
for subtraction, * for multiplication
End
STARTSHOW “Type a mathematical operator to selection: + for addition, / for divisions, - for subtraction and * for multiplication.”READ Selector 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 CASESHOW TEND
![Page 10: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/10.jpg)
Enter a value:
Enter b value:
Enter a symbol to select a operation
+ for addition
/ division
- subtraction
* multiplication
Total
![Page 11: Conditional](https://reader036.vdocuments.us/reader036/viewer/2022082702/554ef7ccb4c90577698b488c/html5/thumbnails/11.jpg)
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 ;• String selector;• a= convert. ToDouble
(textbox1.Text);• b=convert.ToDouble(Te
xtbox2.Text);• Selector=TextBox3.Text
);