Sequence Program 2 – AverageSystem

This layout shows a line for line translation of a data table and an algorithm.

Problem: AverageSystem Problem: AverageSystem
Data Table // Variables
Num1- Integer var Num1 = 0 ;
Num2- Integer var Num2 = 0 ;
Sum – Real var Sum = 0.0 ;
Average – Real var Average = 0.0 ;
Algorithm // Main Program
Begin // Begin AverageSystem
Get Num1 Num1 = prompt (‘Type number 1:’) ;
Get Num2 Num2 = prompt (‘Type number 2:’) ;
Calculate Sum as Num1 + Num2 Sum = Number1 + Number2 ;
Calculate Average as Sum / 2 Average = Sum / 2 ;
Display ‘Average = ‘ Average alert (‘Average = ‘ + Average) ;
End // End AverageSystem

Next: Sequence Javascript Program 2 – AverageSystem