How to resolve the algorithm Multiplication tables step by step in the VBScript programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Multiplication tables step by step in the VBScript programming language

Table of Contents

Problem Statement

Produce a formatted   12×12   multiplication table of the kind memorized by rote when in primary (or elementary) school.

Only print the top half triangle of products.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Multiplication tables step by step in the VBScript programming language

Source code in the vbscript programming language

function pad(s,n) if n<0 then pad= right(space(-n) & s ,-n) else  pad= left(s& space(n),n) end if 
End Function
Sub print(s): 
  On Error Resume Next
  WScript.stdout.Write (s)  
  If  err= &h80070006& Then WScript.Echo " Please run this script with CScript": WScript.quit
End Sub
For i=1 To 12
  print pad(i,-4)
Next
print vbCrLf & String(48,"_")
For i=1 To 12
  print vbCrLf
  For j=1 To 12
    if j
  Next
  print "|"& pad(i,-2)
Next

  

You may also check:How to resolve the algorithm Object serialization step by step in the ALGOL 68 programming language
You may also check:How to resolve the algorithm Array concatenation step by step in the Nial programming language
You may also check:How to resolve the algorithm Forest fire step by step in the Phix programming language
You may also check:How to resolve the algorithm Cumulative standard deviation step by step in the ALGOL 68 programming language
You may also check:How to resolve the algorithm Hello world/Text step by step in the Ursa programming language