4

Click here to load reader

Estructura Condicional Simple

Embed Size (px)

Citation preview

Page 1: Estructura Condicional Simple

SE

JU

Es

Esve

Si

I

E

Pr

1.

Mo En

==

EMANA 5 J

UAN ALEJ

structura

structura drdadera, e

ntaxis:

If <condició

Instru

End If

roblema

Ingrese po

odule M Sub

End

nd Modu

==========

JUEVES 12

JANDRO RO

a condic

de control ntonces eje

ón> Then

ucciones

a:

or teclado u

Module1 Main() 'declarDim N A

'ingresConsoleN = Con

'evaluo'SI al If N Mo ConEnd If ConsoleSub

ule

==========

2 DE NOVI

OSALES C

ional Sim

que evalúecutaras un

un Número;

rar la As Inte

sar e.Writensole.R

o si eldividi

od 2 = nsole.W

e.ReadK

==========

IEMBRE DE

CORONEL

mple

úa la condin conjunto

; si el nume

variabeger

e("IngrReadLin

l Numerir entr0 Then

WriteLi

Key()

=========

E 2009

ción de unde instruc

ero es PAR,

ble N de

rese un ne

ro es PAre 2, sun ne("Num

=========

na variableciones

visualice u

e tipo

Numero

AR u resid

mero PA

==========

e; si la con

un Mensaje

Entero

o:")

duo da c

AR")

==========

G

DE

ndición se

: "Numero

cero

==========

GRUPO IDA

ELEGADO

cumple o

PAR"

=========

AT

es

==

Page 2: Estructura Condicional Simple

SE

JU

2. ing

Mo En

==

EMANA 5 J

UAN ALEJ

Ingrese pgresado

odule M Sub

End

nd Modu

==========

JUEVES 12

JANDRO RO

por teclad

Module2 Main()

'declarDim N A

ConsoleN = Con

'si el If N Mo ConEnd If ConsoleSub

ule

==========

2 DE NOVI

OSALES C

o un Núme

rar unaAs Inte

e.Writensole.R

numerood 3 = nsole.W

e.ReadK

==========

IEMBRE DE

CORONEL

ero; si es m

a variaeger

e("IngrReadLin

o es mu0 Then

WriteLi

Key()

=========

E 2009

múltiplo de

able de

rese un ne

ultiplo n ne("El

=========

e 3, calcul

tipo E

Numero

de 3

cubo e

==========

e y visuali

Entero

o:")

es:" & N

==========

G

DE

ice el cubo

N * N *

==========

GRUPO IDA

ELEGADO

o del núme

* N)

=========

AT

ero

==

Page 3: Estructura Condicional Simple

SE

JU

3. el

Mo de En

==

EMANA 5 J

UAN ALEJ

Ingrese p descuento

odule M Sub

escuent

End

nd Modu

==========

JUEVES 12

JANDRO RO

por teclado que repr

Module3 Main()

'declarDim pre

'ingresConsoleprecio

'si el If prec des Con

to) End If

ConsoleSub

ule

==========

2 DE NOVI

OSALES C

o el precioresenta el

rar lasecio, d

samos ee.Write= Cons

preciocio > 1scuentonsole.W

e.ReadK

==========

IEMBRE DE

CORONEL

o de un TV 12.5% del

s variadescuen

el prece("Ingrsole.Re

o es ma1999 Tho = preWriteLi

Key()

=========

E 2009

V; si el prel precio.

ables nto As D

cio rese el adLine

ayor a 1hen cio * 0ne("El

=========

ecio es may

Double

precio

1999, a

0.125 descue

==========

yor que 19

o:")

aplico e

ento es

==========

G

DE

999 calcule

el desc

:" &

==========

GRUPO IDA

ELEGADO

e y visualic

cuento

=========

AT

ce

==

Page 4: Estructura Condicional Simple

SE

JU

4. ca

Po

Mo En

EMANA 5 J

UAN ALEJ

Ingrese papicúa (Un

or ejemplo

odule M Sub

End

nd Modu

JUEVES 12

JANDRO RO

por teclad numero es

: 11 --> 11

Module4 Main() Dim NumConsoleNumero

'descomu = Numd = Num

'formarNI = u

'evaluoIf Nume ConEnd If ConsoleSub

ule

2 DE NOVI

OSALES C

o un numes capicúa s

mero, Ne.Write= Cons

mponer mero Momero \

remos e* 10 +

o si elero = Nnsole.W

e.ReadK

IEMBRE DE

CORONEL

ero de dos si al invert

NI, u, e("Ingrsole.Re

en uniod 10 10

el nume+ d

l NI = NI ThenWriteLi

Key()

E 2009

cifras; vistir sus cif

d As Inrese un adLine

dad y d

ro inve

Numeron ne("El

sualice un fras es el m

ntegerNumero

decena

ertido

numero

mensaje smismo num

o de 2 c

o es cap

G

DE

si el numermero.

cifras:

picua")

GRUPO IDA

ELEGADO

ro es

:")

)

AT