Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
16
Task/User-input-Text/JavaScript/user-input-text-3.js
Normal file
16
Task/User-input-Text/JavaScript/user-input-text-3.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const readline = require("readline");
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
|
||||
rl.question("Enter a string: ", (str) => {
|
||||
console.log(str);
|
||||
rl.close();
|
||||
});
|
||||
|
||||
rl.question("Enter a number: ", (n) => {
|
||||
console.log(parseInt(n));
|
||||
rl.close();
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
print('Enter a string: ')
|
||||
s = io.stdin:read()
|
||||
print('Enter a number: ')
|
||||
i = tonumber(io.stdin:read())
|
||||
i = io.stdin:read"n"
|
||||
|
|
|
|||
30
Task/User-input-Text/OPL/user-input-text.opl
Normal file
30
Task/User-input-Text/OPL/user-input-text.opl
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
PROC usrinpt:
|
||||
LOCAL string$(15),number&
|
||||
WHILE string$=""
|
||||
PRINT "Please enter a string."
|
||||
INPUT string$
|
||||
IF string$=""
|
||||
PRINT "Nothing was entered. Please try again."
|
||||
PAUSE 60
|
||||
CLS
|
||||
ENDIF
|
||||
ENDWH
|
||||
PRINT "Thank you! You entered: ";string$
|
||||
WHILE number&<>75000
|
||||
PRINT "Please enter the number 75000."
|
||||
TRAP INPUT number&
|
||||
IF ERR=-1
|
||||
PRINT
|
||||
PRINT "That's not a valid number. Please try again."
|
||||
PAUSE 60
|
||||
CLS
|
||||
ELSEIF number&<>75000
|
||||
PRINT "Wrong number. Please try again."
|
||||
PAUSE 60
|
||||
CLS
|
||||
ENDIF
|
||||
ENDWH
|
||||
PRINT "Good job! You successfully entered 75000!"
|
||||
PRINT "Press any key to continue."
|
||||
GET
|
||||
ENDP
|
||||
Loading…
Add table
Add a link
Reference in a new issue