Hp 49g Graphing Calculator Instrukcja Użytkownika Strona 202

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 242
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 201
1 2 ... 197 198 199 200 201 202 203 204 205 206 207 ... 241 242

Komentarze do niniejszej Instrukcji

Brak uwag