How to resolve the algorithm Idiomatically determine all the characters that can be used for symbols step by step in the XPL0 programming language
How to resolve the algorithm Idiomatically determine all the characters that can be used for symbols step by step in the XPL0 programming language
Table of Contents
Problem Statement
Idiomatically determine all the characters that can be used for symbols. The word symbols is meant things like names of variables, procedures (i.e., named fragments of programs, functions, subroutines, routines), statement labels, events or conditions, and in general, anything a computer programmer can choose to name, but not being restricted to this list. Identifiers might be another name for symbols. The method should find the characters regardless of the hardware architecture that is being used (ASCII, EBCDIC, or other). Display the set of all the characters that can be used for symbols which can be used (allowed) by the computer program. You may want to mention what hardware architecture is being used, and if applicable, the operating system. Note that most languages have additional restrictions on what characters can't be used for the first character of a variable or statement label, for instance. These type of restrictions needn't be addressed here (but can be mentioned).
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Idiomatically determine all the characters that can be used for symbols step by step in the XPL0 programming language
Source code in the xpl0 programming language
char C, C1;
[Text(0, "First character set: ");
for C:= 0 to 255 do
if C>=^A then if C<=^Z ! C=^_ then
ChOut(0, C);
CrLf(0);
Text(0, "Next characters set: ");
for C:= 0 to 255 do
[if C>=^a & C<=^z then C1:= C & $DF \to uppercase
else C1:= C;
case of
C1>=^A & C1<=^Z, C1>=^0 & C1<=^9, C1=^_ :
ChOut(0, C)
other [];
];
CrLf(0);
]
You may also check:How to resolve the algorithm First-class functions step by step in the R programming language
You may also check:How to resolve the algorithm Same fringe step by step in the Raku programming language
You may also check:How to resolve the algorithm Convert seconds to compound duration step by step in the Standard ML programming language
You may also check:How to resolve the algorithm Formatted numeric output step by step in the Icon and Unicon programming language
You may also check:How to resolve the algorithm String interpolation (included) step by step in the Factor programming language