Hp 49g Graphing Calculator Manual do Utilizador Página 202

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 242
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 201
Example
The following example creates the list of marks used in the previous
example. If a non-numeric value is entered, the program prompts with an
error message. The program performs the following:
® It sets up a loop to collect 20 values.
® It prompts for an input value.
® It tests the input to check if it is a number.
® If the generates an error, the error is trapped, and an error message is
displayed to prompt for a numeric value.
«
@ Set numeric mode so that error trap works
SF{-3) ;
@ Create an empty list
{}►marks ;
@ Set up a loop for 20 entries.
WHILE SIZE(MARKS)<20 REPEAT
@ Start error-checking routine.
IFERR INPUT("Enter a number","") N
@ Attempt to convert the entry to a number.
@ This generates an error if non-numeric
« OBJ^(N)+l-l -y N
® If no error, append the entry to the list.
« MARKS+N ► MARKS
THEN
©This appears if entry is non-numeric.
MSGBOX("INVALID ENTRY, TRY AGAIN")
END ;
END
Page 10-16
Introduction to programming
Vista de página 201
1 2 ... 197 198 199 200 201 202 203 204 205 206 207 ... 241 242

Comentários a estes Manuais

Sem comentários