TRABAJO DE INVESTIGACIÓN DEL CURSO DE ALGORITMOS 2005-2

 

De acuerdo a la tendencia de la universidad a exigir plenamente más investigación los alumnos deberán investigar los siguientes temas asignados a cada uno según la lista adjunta.

 

Observe este texto extraido de la ayuda del QBASIC donde se muestran las ordenes, funciones y palabras reservadas.

 

Texto extraído de la ayuda de QBASIC
 
To get help on a QBasic keyword in the list below:
    1. Press the key of the first letter of the keyword.
    2. Use the direction keys to move the cursor to the keyword.
    3. Press F1 to display the help text in the Help window.

A

  ABS Function                       APPEND Keyword
  ABSOLUTE Keyword                   AS Keyword
  ACCESS Keyword                     ASC Function
  AND Operator                       ATN Function
  ANY Keyword

B

  BASE Keyword                       BLOAD Statement
  Basic Character Set                Boolean Operators
  BEEP Statement                     BSAVE Statement
  BINARY Keyword

C

  CALL Statement                     COLOR Statement
  CALL ABSOLUTE Statement            COM Statement
  CASE Keyword                       COMMON Statement
  CDBL Function                      CONST Statement
  CHAIN Statement                    COS Function
  CHDIR Statement                    CSNG Function
  CHR$ Function                      CSRLIN Function
  CINT Function                      CVD Function
  CIRCLE Statement                   CVDMBF Function
  CLEAR Statement                    CVI Function
  CLNG Function                      CVL Function
  CLOSE Statement                    CVS Function
  CLS Statement                      CVSMBF Function

D

  DATA Statement                     DEFLNG Statement
  Data Type Keywords                 DEFSNG Statement
  DATE$ Function                     DEFSTR Statement
  DATE$ Statement                    DIM Statement
  DECLARE Statement                  DO...LOOP Statement
  DEF FN Statement                   DOUBLE Keyword
  DEF SEG Statement                  DRAW Statement
  DEFDBL Statement                   $DYNAMIC Metacommand
  DEFINT Statement

E

  ELSE Keyword                       ERDEV Function
  ELSEIF Keyword                     ERDEV$ Function
  END Statement                      ERL Function
  ENVIRON Statement                  ERR Function
  ENVIRON$ Function                  ERROR Statement
  EOF Function                       EXIT Statement
  EQV Operator                       EXP Function
  ERASE Statement

F

  FIELD Statement                    FOR...NEXT Statement
  FILEATTR Function                  FRE Function
  FILES Statement                    FREEFILE Function
  FIX Function                       FUNCTION Statement

G

  GET (File I/O) Statement           GOSUB Statement
  GET (Graphics) Statement           GOTO Statement

H

  HEX$ Function

I

  IF...THEN...ELSE Statement         INSTR Function
  IMP Operator                       INT Function
  INKEY$ Function                    INTEGER Keyword
  INP Function                       IOCTL Statement
  INPUT Statement                    IOCTL$ Function
  INPUT$ Function                    IS Keyword

K

  KEY (Assignment) Statement         KILL Statement
  KEY (Event Trapping) Statement

L

  LBOUND Function                    LOCK...UNLOCK Statements
  LCASE$ Function                    LOF Function
  LEFT$ Function                     LOG Function
  LEN Function                       LONG Keyword
  LET Statement                      LOOP Keyword
  LINE (Graphics) Statement          LPOS Function
  LINE INPUT Statement               LPRINT Statement
  LIST Keyword                       LPRINT USING Statement
  LOC Function                       LSET Statement
  LOCATE Statement                   LTRIM$ Function

M

  MID$ Function                      MKI$ Function
  MID$ Statement                     MKL$ Function
  MKD$ Function                      MKS$ Function
  MKDIR Statement                    MKSMBF$ Function
  MKDMBF$ Function                   MOD Operator

N

  NAME Statement                     NOT Operator
  NEXT Keyword

O

  OCT$ Function                      ON TIMER Statement
  OFF Keyword                        ON...GOSUB Statement
  ON COM Statement                   ON...GOTO Statement
  ON ERROR Statement                 OPEN Statement
  ON Keyword                         OPEN COM Statement
  ON KEY Statement                   OPTION BASE Statement
  ON PEN Statement                   OR Operator
  ON PLAY Statement                  OUT Statement
  ON STRIG Statement                 OUTPUT Keyword

P

  PAINT Statement                    POINT Function
  PALETTE Statements                 POKE Statement
  PCOPY Statement                    POS Function
  PEEK Function                      PRESET Statement
  PEN Function                       PRINT Statement
  PEN Statement                      PRINT USING Statement
  PLAY Function                      PSET Statement
  PLAY (Music) Statement             PUT (File I/O) Statement
  PLAY (Event Trapping) Statements   PUT (Graphics) Statement
  PMAP Function

R

  RANDOM Keyword                     RETURN Statement
  RANDOMIZE Statement                RIGHT$ Function
  READ Statement                     RMDIR Statement
  REDIM Statement                    RND Function
  REM Statement                      RSET Statement
  RESET Statement                    RTRIM$ Function
  RESTORE Statement                  RUN Statement
  RESUME Statement

S

  SCREEN Function                    SQR Function
  SCREEN Statement                   STATIC Statement
  SEEK Function                      $STATIC Metacommand
  SEEK Statement                     STEP Keyword
  SELECT CASE Statement              STICK Function
  SGN Function                       STOP Statement
  SHARED Statement                   STR$ Function
  SHELL Statement                    STRIG Function
  SIN Function                       STRIG Statements
  SINGLE Keyword                     STRING Keyword
  SLEEP Statement                    STRING$ Function
  SOUND Statement                    SUB Statement
  SPACE$ Function                    SWAP Statement
  SPC Function                       SYSTEM Statement

T

  TAB Function                       TIMER Statements
  TAN Function                       TO Keyword
  THEN Keyword                       TROFF Statement
  TIME$ Function                     TRON Statement
  TIME$ Statement                    TYPE Statement
  TIMER Function

U

  UBOUND Function                    UNTIL Keyword
  UCASE$ Function                    USING Keyword
  UNLOCK Statement

V

  VAL Function                       VARSEG Function
  VARPTR Function                    VIEW Statement
  VARPTR$ Function                   VIEW PRINT Statement

W

  WAIT Statement                     WIDTH Statements
  WEND Keyword                       WINDOW Statement
  WHILE...WEND Statement             WRITE Statement

X

  XOR Operator

 

 

Trabajo de Investigación

 

Modalidad: Experimento de autoaprendizaje.

 

Lograr que el alumno se inicie en la investigación de un lenguaje de computadoras

y desarrolle un conjunto de programas básicos en este entorno.

 

Resolver la siguiente pregunta:

 

1.- Que es un keyword, un statement, una function y un operaror en QBASIC?

 

 

Luego armar un conjunto de páginas Web para el autoaprendizaje, y sirva como material de consulta y autoaprendizaje

 

2.- Separar todos los statements en una lista aparte, ordenarlos alfabéticamente, leer en la ayuda de QBASIC para que sirve cada uno de ellos
 

y escribir un pequeño manual de statetments.
 

para llevar a cabo esto el alumno usando FrontPage creara una página web que sirva de manual de los STATEMENTS traducidos para que todos los alumnos puedan leer las explicaciones, esta tarea se dividirá en en 3 partes de la siguiente forma:

 

APELLIDOS DE ALUMNOS desde la A (por ejemplo ANDRADE) hasta la D (por ejemplo DELGADO) 

realizarán esta labor para los statements desde la A hasta la G.

 

APELLIDOS DE ALUMNOS desde la E (por ejemplo ESTELA) hasta la R (por ejemplo RUIZ) 

realizarán esta labor para los statements desde la H hasta la O.

 

APELLIDOS DE ALUMNOS desde la S (por ejemplo SOSA) hasta la Z (por ejemplo ZELADA) 

realizarán esta labor para los statements desde la P hasta la X

 

 

Metodología y forma de presentación en FRONTPAGE:

 

Sentencia, orden o comando (STATEMENT)  
PASO 1.- TOMAR EL TEXTO EN INGLES

INPUT reads input from the keyboard or a file. LINE INPUT reads a line of up to 255 characters from the keyboard or a file.

INPUT [;] ["prompt"{; | ,}] variablelist
LINE INPUT [;] ["prompt";] variable$
INPUT #filenumber%, variablelist
LINE INPUT #filenumber%, variable$

■ prompt An optional literal string that is displayed before
the user enters data. A semicolon after prompt appends
a question mark to the prompt string.
■ variablelist One or more variables, separated by commas, in which
data entered from the keyboard or read from a file is
stored. Variable names can consist of up to 40
characters and must begin with a letter. Valid
characters are A-Z, 0-9, and period (.).
■ variable$ Holds a line of characters entered from the keyboard
or read from a file.

■ filenumber% The number of an open file.

■ INPUT uses a comma as a separator between entries.
LINE INPUT reads all characters up to a carriage return.
■ For keyboard input, a semicolon immediately after INPUT keeps the
cursor on the same line after the user presses the Enter key.

PASO 2.- TRADUCIRLO E INTERPRETAR EN CASTELLANO

INPUT lee entradas desde el teclado o un archivo. LINE INPUT lee una linea de hasta 255 caracteres desde el teclado o un archivo.

 

INPUT [;] ["mensaje"{; | ,}] lista de variables
LINE INPUT [;] ["mensaje";] variable$
INPUT #numerodearchivo%, lista de variables
LINE INPUT #numerodearchivo%, variable$
 

* Prompt (mensaje), una cadena de caracteres opcional que es mostrada antes que el usuario ingresese datos. un punto y coma despues del mensaje añade un signo de interrogacion ? al mensaje mostrado.

 

* variablelist (lista de variables) una o mas variables, separada por comas, en los cuales serán almacenados los datos ingresados desde el teclado o leidos de un archivo. Los nombres de las variables pueden ser de hasta 40 caracteres y deberán empezar con una letra . Los caracteres validos son A-Z, 0-9, y punto (.)

 

* Variable$ almacena una linea de caracteres ingresada desde el teclado o leido desde un archivo

 

* Filenumber%, (numero de archivo) el número de un archivo abierto

 

* INPUT usa una coma como separador entre entradas

*LINE INPUT lee todos los caracteres hasta encontrar un salto de linea (carriage return).

* Para entrada desde teclado, dos puntos (:) inmediatamente despues de INPUT mantiene el curso sobre la misma linea despues que el usuario presiona la tecla ENTER.

PASO 3.- DARLE UN FORMATO ADECUADO

 

INPUT lee entradas desde el teclado o un archivo. LINE INPUT lee una linea de hasta 255 caracteres desde el teclado o un archivo.

 

Sintaxis del comando

 

INPUT            [;] ["mensaje"{; | ,}] lista de variables
LINE INPUT  [;] ["mensaje";] variable$
INPUT            #numerodearchivo%, lista de variables
LINE INPUT  #numerodearchivo%, variable$
 

Comentarios

  • Prompt (mensaje), una cadena de caracteres opcional que es mostrada antes que el usuario ingrese datos. un punto y coma después del mensaje añade un signo de interrogación ? al mensaje mostrado.
  •  variablelist (lista de variables) una o mas variables, separada por comas, en los cuales serán almacenados los datos ingresados desde el teclado o leídos de un archivo. Los nombres de las variables pueden ser de hasta 40 caracteres y deberán empezar con una letra . Los caracteres validos son A-Z, 0-9, y punto (.)
  • Variable$ almacena una linea de caracteres ingresada desde el teclado o leído desde un archivo
  • Filenumber%, (numero de archivo) el número de un archivo abierto
  • INPUT usa una coma como separador entre entradas
  • LINE INPUT lee todos los caracteres hasta encontrar un salto de línea (carriage return).
  • Para entrada desde teclado, dos puntos (:) inmediatamente después de INPUT mantiene el curso sobre la misma línea después que el usuario presiona la tecla ENTER.

EJEMPLO:
CLS
OPEN "LIST" FOR OUTPUT AS #1
DO
     INPUT " Nombre: ", Name$ 'lee entradas desde el teclado.
     INPUT " Edad: ", Age$
     WRITE #1, Name$, Age$
     INPUT "Añadir otra entrada (S/N)"; R$
LOOP WHILE UCASE$(R$) = "S"
CLOSE #1
'mostrar el archivo de vuelta.
OPEN "LIST" FOR INPUT AS #1
CLS
PRINT "Entradas en el archivo:": PRINT
DO WHILE NOT EOF(1)
     LINE INPUT #1, REC$ 'lee la entrada desde el archivo.
     PRINT REC$ 'muestra en pantalla las entradas.
LOOP
CLOSE #1
KILL "LIST"

PASO 4.- AÑADIRLE DE SU PROPIA IMAGINACIÓN

 

Programa que demuestra el uso de INPUT

 

CLS

INPUT "ingrese un numero"; a

INPUT " ingrese otro numero";b

c =   a + b

PRINT "la suma de los números es  "; c

END

 

Explicación

Este programa  permite el Ingreso de 2 datos al PC

se ingresa el primer número y se presiona ENTER

se ingresa el segundo número y se presiona ENTER

luego el programa calcula la suma y muestra la respuesta

 

 

 

 

Resultado final

 

INPUT 

 

LINE INPUT

 

INPUT  lee entradas desde el teclado o un archivo. LINE INPUT lee una linea de hasta 255 caracteres desde el teclado o un archivo.

 

Sintaxis del comando

 

 

INPUT            [;] ["mensaje"{; | ,}] lista de variables
LINE INPUT  [;] ["mensaje";] variable$
INPUT            #numerodearchivo%, lista de variables
LINE INPUT  #numerodearchivo%, variable$

 

Comentarios

EJEMPLO:

CLS
OPEN "LIST" FOR OUTPUT AS #1
DO
     INPUT " Nombre: ", Name$ 'lee entradas desde el teclado.
     INPUT " Edad: ", Age$
     WRITE #1, Name$, Age$
     INPUT "Añadir otra entrada (S/N)"; R$
LOOP WHILE UCASE$(R$) = "S"
CLOSE #1
'mostrar el archivo de vuelta.
OPEN "LIST" FOR INPUT AS #1
CLS
PRINT "Entradas en el archivo:": PRINT
DO WHILE NOT EOF(1)
     LINE INPUT #1, REC$ 'lee la entrada desde el archivo.
     PRINT REC$ 'muestra en pantalla las entradas.
LOOP
CLOSE #1
KILL "LIST"

 

 

Programa 01 que demuestra el uso de INPUT

 

CLS

INPUT "ingrese un numero"; a

INPUT " ingrese otro numero";b

c =   a + b

PRINT "la suma de los números es  "; c

END

 

Explicación

Este programa  permite el ingreso de 2 datos al PC

se ingresa el primer número y se presiona ENTER

se ingresa el segundo número y se presiona ENTER

luego el programa calcula la suma y muestra la respuesta

 

3.- Adecuación de lo aprendido a las unidades de aprendizaje del curso

 

Una vez que todos los alumnos hayan presentado sus paginas Web, se elaborará un programa en QBASIC que demande un mayor esfuerzo para que se pueda darle un uso práctico real este será

 

UN PROGRAMA EN QBASIC QUE PERMITA REGISTRAR UN ÁLBUM DE PELÍCULAS 

CON LAS SIGUIENTES OPCIONES:

 

MENÚ MI ÁLBUM DE PELÍCULAS

 

    1.-  REGISTRAR UNA NUEVA PELÍCULA

    2.-  HACER CAMBIOS EN UNA PELÍCULA REGISTRADA

    3.-  MOSTRAR LA LISTA DE PELÍCULAS ORDENADAS POR NOMBRE

    4.-  MOSTRAR LA LISTA DE PELÍCULAS ORDENADAS POR ESTUDIO (UNIVERSAL, FOX, COLUMBIA PICTURES...)

    5.-  ELIMINAR UNA PELÍCULA DE LA LISTA

    6.-  IMPRIMIR LA LISTA en el impresor

    7.-  SALIR

 

 

 

4.- Cambio de Lenguaje, Como migrar del QBASIC al LENGUAJE C....    Significa aplicar la experiencia anterior al LENGUAJE C

 

Volver al PASO 1   y aplicar todo lo aprendido en QBASIC al Estudio del lenguaje C (*)

 

5.- Cambio de Lenguaje, Como migrar del QBASIC al PASCAL....  Significa aplicar la experiencia anterior al LENGUAJE C

 

Volver al PASO 1   y aplicar todo lo aprendido en QBASIC al Estudio del lenguaje PASCAL (*)

 

(*).- Los alumnos del cuyo número de orden en el salón sea anterior a la mitad lo harán en LENGUAJE C y el resto en PASCAL

 

El trabajo es individual no existen grupos.