How to resolve the algorithm Idiomatically determine all the lowercase and uppercase letters step by step in the AWK programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Idiomatically determine all the lowercase and uppercase letters step by step in the AWK programming language

Table of Contents

Problem Statement

Idiomatically determine all the lowercase and uppercase letters   (of the Latin [English] alphabet)   being used currently by a computer programming language. The method should find the letters regardless of the hardware architecture that is being used (ASCII, EBCDIC, or other).

Display the set of all: that can be used (allowed) by the computer program, where   letter   is a member of the Latin (English) alphabet:     a ──► z     and     A ──► Z.

You may want to mention what hardware architecture is being used, and if applicable, the operating system.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Idiomatically determine all the lowercase and uppercase letters step by step in the AWK programming language

Source code in the awk programming language

# syntax: GAWK -f IDIOMATICALLY_DETERMINE_ALL_THE_LOWERCASE_AND_UPPERCASE_LETTERS.AWK
BEGIN {
    for (i=0; i<=255; i++) {
      c = sprintf("%c",i)
      if (c ~ /[[:lower:]]/) {
        lower_chars = lower_chars c
      }
      if (c ~ /[[:upper:]]/) {
        upper_chars = upper_chars c
      }
    }
    printf("%s\n",ARGV[0])
    printf("lowercase %d: %s\n",length(lower_chars),lower_chars)
    printf("uppercase %d: %s\n",length(upper_chars),upper_chars)
    exit(0)
}


  

You may also check:How to resolve the algorithm Fivenum step by step in the J programming language
You may also check:How to resolve the algorithm GUI/Maximum window dimensions step by step in the PureBasic programming language
You may also check:How to resolve the algorithm Rock-paper-scissors step by step in the D programming language
You may also check:How to resolve the algorithm Polymorphic copy step by step in the J programming language
You may also check:How to resolve the algorithm Order disjoint list items step by step in the Mathematica/Wolfram Language programming language