1
C, C++, C#, Java, Visual Basic, HTML, PHP, CSS, Javascript, Ajax, Joomla, MySql y más / Re:Ejemplo bucle while en Pascal, programa que no termine hasta cumplirse condición
« en: 10 de Marzo 2015, 10:48 »
A tí por la ayuda
Aprende a programar desde cero con el libro "Aprender a programar. Algoritmos y fundamentos de programación orientados a la ingeniería y ciencias". 748 pgs. Editorial aprenderaprogramar.com.
Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.
program portas;
USES Crt;
var
rbusqueda: char;
numporta: string;
begin
rbusqueda := 'S';
WHILE (rbusqueda = ('S')) DO
begin
writeln ('Escribe el numero del porta, matricula o nombre del conductor (mayuscula)...');
writeln ('');
readln(numporta);
//Portavehiculos 001
if (numporta = ('001')) or (numporta = ('0000XXX')) or (numporta = ('NOMBRE1'))
then
begin
writeln('NOMBRE1');
writeln('Portavehiculos 001');
writeln('Matricula: 0000-XXX');
writeln('EXT:00001');
writeln('Movil: 666666666');
writeln ('=============================');
end
//Portavehiculos 002
else if (numporta = ('002')) or (numporta = ('0000ZZZ')) or (numporta = ('NOMBRE2'))
then
begin
writeln('NOMBRE2');
writeln('Portavehiculos 002');
writeln('Matricula: 0000-ZZZ');
writeln('EXT:00002');
writeln('Movil: 666666667');
writeln ('=============================');
end
//Portavehiculos 003
else if (numporta = ('003')) or (numporta = ('0000VVV')) or (numporta = ('NOMBRE3'))
then
begin
writeln('NOMBRE3');
writeln('Portavehiculos 003');
writeln('Matricula: 0000-VVV');
writeln('EXT:00003');
writeln('Movil: 666666668');
writeln ('=============================');
end
else writeln('No es un numero de porta valido');
writeln;
writeln ('¿Quiere realizar otra busqueda? (S/N)');
writeln ('');
readln(rbusqueda);
end;
end.
program portas;
USES Crt;
var
numporta: string;
begin
writeln ('Escribe el numero del porta, matricula o nombre del conductor (mayuscula)...');
writeln ('');
readln(numporta);
//Portavehiculos 001
if (numporta = ('001')) or (numporta = ('0000XXX')) or (numporta = ('NOMBRE1'))
then
begin
writeln('NOMBRE1');
writeln('Portavehiculos 001');
writeln('Matricula: 0000-XXX');
writeln('EXT:00001');
writeln('Movil: 666666666');
writeln ('=============================');
end
//Portavehiculos 002
else if (numporta = ('002')) or (numporta = ('0000ZZZ')) or (numporta = ('NOMBRE2'))
then
begin
writeln('NOMBRE2');
writeln('Portavehiculos 002');
writeln('Matricula: 0000-ZZZ');
writeln('EXT:00002');
writeln('Movil: 666666667');
writeln ('=============================');
end
//Portavehiculos 003
else if (numporta = ('003')) or (numporta = ('0000VVV')) or (numporta = ('NOMBRE3'))
then
begin
writeln('NOMBRE3');
writeln('Portavehiculos 003');
writeln('Matricula: 0000-VVV');
writeln('EXT:00003');
writeln('Movil: 666666668');
writeln ('=============================');
end
writeln;
writeln;
writeln('Pulsa ENTER para salir');
readln
end.
writeln;
writeln;
writeln('Pulsa ENTER para salir');
readln
end.
program portas;
USES Crt;
var
numporta: string;
dec: char;
Procedure inicio ;
begin
.....
.....
writeln;
writeln;
writeln ('Continuar? (S/N)') ;
readln (dec);
if (dec = ('S'))
then begin inicio;
else
end.
var ejemplo:string;
begin
writeln (introduce un vehiculo);
readln (ejemplo);
if (ejemplo= ('056') or ('2589JHZ'))
then begin
writeln ('esta viendo el vehiculo 056 con matricula 258JHZ');
else
writeln ('ese vehiculo no esta en nuestra base de datos');
end.
if (ejemplo=('056')) or (ejemplo = ('2589JHZ'))
program portas;
var
numporta: real;
begin
writeln('Escribe el numero del porta');
readln(numporta);
writeln;
writeln;
writeln ('=============================');
//Portavehiculos 000
if (numporta = 000)
then
begin
writeln('Nombre conductor');
writeln('Portavehiculos 000');
writeln('Matricula: 000-XYZ');
writeln('EXT:00000');
writeln('Movil: 000000000');
writeln ('=============================');
end
//Portavehiculos 001
if (numporta = 001)
then
begin
writeln('Nombre conductor');
writeln('Portavehiculos 001');
writeln('Matricula: 000-XYZ');
writeln('EXT:00000');
writeln('Movil: 000000000');
writeln ('=============================');
end
else writeln('No es un numero de porta valido');
writeln;
writeln;
writeln('Pulsa ENTER para salir');
readln
end.
[code]
program portas;
var
numporta: string;
begin
writeln('Escribe el numero del porta');
readln(numporta);
writeln;
writeln;
writeln ('=============================');
//Portavehiculos 000
if (numporta = 000 or 000XYZ)
then
begin
writeln('Nombre conductor');
writeln('Portavehiculos 000');
writeln('Matricula: 000-XYZ');
writeln('EXT:00000');
writeln('Movil: 000000000');
writeln ('=============================');
end
//Portavehiculos 001
if (numporta = 001 or 000XYZ)
then
begin
writeln('Nombre conductor');
writeln('Portavehiculos 001');
writeln('Matricula: 000-XYZ');
writeln('EXT:00000');
writeln('Movil: 000000000');
writeln ('=============================');
end
else writeln('No es un numero de porta valido');
writeln;
writeln;
writeln('Pulsa ENTER para salir');
readln
end.
Sobre la educación, sólo puedo decir que es el tema más importante en el que nosotros, como pueblo, debemos involucrarnos.
Abraham Lincoln (1808-1865) Presidente estadounidense.
aprenderaprogramar.com: Desde 2006 comprometidos con la didáctica y divulgación de la programación