Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more ➡
Download
Standard view
Full view
of .
Add note
Save to My Library
Sync to mobile
Look up keyword
Like this
8Activity
×
0 of .
Results for:
No results containing your search query
P. 1
Ejercicios de programación

Ejercicios de programación

Ratings:

4.5

(2)
|Views: 3,945|Likes:

More info:

Published by: joseluiscabreraperez on Jun 30, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, DOC, TXT or read online from Scribd
See More
See less

11/05/2012

pdf

text

original

 
Universidad técnica “José Peralta”
Ejercicios de programación
1.- Realizar todos los ejercicio en Visual.net y presentarlos en disquete e impresos
Programa para el mayor de tres números y menor de cinco.
Module Module1Public a, b, c, d, e As IntegerClass ingresomaySub leer()Console.WriteLine("INGRESE EL PRIMER NUMERO:.")a = Console.ReadLineConsole.WriteLine("INGRESE EL SEGUNDO NUMERO:.")b = Console.ReadLineConsole.WriteLine("INGRESE EL TERCER NUMERO:.")c = Console.ReadLineEnd SubEnd ClassClass ingresomenSub leer()Console.WriteLine("INGRESE EL PRIMER NUMERO:.")a = Console.ReadLineConsole.WriteLine("INGRESE EL SEGUNDO NUMERO:.")b = Console.ReadLineConsole.WriteLine("INGRESE EL TERCER NUMERO:.")c = Console.ReadLineConsole.WriteLine("INGRESE EL CUARTO NUMERO:.")d = Console.ReadLineConsole.WriteLine("INGRESE EL QUINTO NUMERO:.")e = Console.ReadLineEnd SubEnd ClassClass mayorInherits ingresomaySub mayor()If (a > b) And (a > c) ThenConsole.WriteLine("EL MAYOR ES EL PRIMER NUMERO")ElseIf (b > a) And (b > c) ThenConsole.WriteLine("EL MAYOR ES EL SEGUNDO NUMERO")ElseIf (c > a) And (c > b) ThenConsole.WriteLine("EL MAYOR ES EL TERCERNUMERO NUMERO")End IfEnd IfEnd IfEnd SubEnd ClassClass menorInherits ingresomenSub menor()If (a < b) And (a < c) And (a < d) And (a < e) ThenConsole.WriteLine("EL MENOR ES EL PRIMER NUMERO")Else
1
 
Universidad técnica “José Peralta”
If (b < a) And (b < c) And (b < d) And (b < e) ThenConsole.WriteLine("EL MENOR ES EL SEGUNDO NUMERO")ElseIf (c < b) And (c < a) And (c < d) And (c < e)ThenConsole.WriteLine("EL MENOR ES EL TERCERNUMERO")ElseIf (d < a) And (d < b) And (d < c) And (d < e)ThenConsole.WriteLine("EL MENOR ES EL CUARTONUMERO")ElseIf (e < a) And (e < b) And (e < c) And (e< d) ThenConsole.WriteLine("EL MENOR ES ELQUINTO NUMERO")End IfEnd IfEnd IfEnd IfEnd IfEnd SubEnd ClassSub Main()Dim ing As New ingresomayDim ingm As New ingresomenDim op As IntegerDim may As New mayorDim men As New menorWhile (op <> 3)Console.WriteLine("....MENU PRINCIPAL....")Console.WriteLine("(..1..) MAYOR DE TRES NUMEROS")Console.WriteLine("(..2..) MENOR DE CINCO NUMEROS")Console.WriteLine("(..3..) SALIR")op = Console.ReadLineSelect Case opCase 1Console.WriteLine("**INGRESE LOS TRES NUMEROS**")ing.leer()Console.ReadLine()may.mayor()Case 2Console.WriteLine("**INGRESE LOS CINCO NUMEROS**")ingm.leer()Console.ReadLine()men.menor()End SelectEnd WhileEnd SubEnd Module
2
 
Universidad técnica “José Peralta”
Programa para las áreas del rombo, trapecio y el paralelogramo.
Module Module1Public area As IntegerSub Main()Dim rom As New romboDim par As New paralelogramoDim tra As New trapecioDim op As IntegerWhile (op <> 4)Console.WriteLine("**MENU PRINCIPAL**")Console.WriteLine("1.-- AREA DEL ROMBO")Console.WriteLine("2.-- AREA DEL PARALELOGRAMO")Console.WriteLine("3.-- AREA DEL TRAPECIO")Console.WriteLine("4.-- SALIR")op = Console.ReadLineSelect Case opCase 1rom.leer()Case 2par.leer()Case 3tra.leer()End SelectEnd WhileEnd SubClass romboDim dmy, dme As IntegerSub leer()Console.WriteLine("*** AREA DEL ROMBO***")Console.WriteLine("INGRESE LA DIAGONAL MAYOR:..")dmy = Console.ReadLineConsole.WriteLine("INGRESE LA DIAGONAL MENOR:..")dme = Console.ReadLinearea = (dmy * dme) / 2Console.WriteLine("EL AREA DEL ROMBO ES: {0}", area)Console.ReadLine()End SubEnd ClassClass paralelogramoDim b, a As IntegerSub leer()Console.WriteLine("*** AREA DEL PARALELOGRAMO***")Console.WriteLine("INGRESE LA BASE:..")b = Console.ReadLineConsole.WriteLine("INGRESE LA ALTURA:..")a = Console.ReadLinearea = (b * a)Console.WriteLine("EL AREA DEL PARALELOGRAMO ES: {0}",area)Console.ReadLine()End SubEnd ClassClass trapecioDim bmay, bmen, a As IntegerSub leer()
3

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->