1. Home
  2. /
  3. Simula
  4. /
  5. Prime Checker

Prime Checker - Simula Typing CST Test

Loading…

Prime Checker — Simula Code

Checks if numbers are prime.

BEGIN
	ARRAY nums[3]; nums[0]:=7; nums[1]:=10; nums[2]:=13;
	INTEGER n,i; BOOLEAN isPrime;
	FOR n IN nums DO
		isPrime := TRUE;
		FOR i := 2 STEP 1 UNTIL n-1 DO
		IF n MOD i = 0 THEN isPrime := FALSE END;
		END;
		OutInt(n,0);
		IF isPrime THEN OutText(" is Prime") ELSE OutText(" is Not Prime") END; OutImage;
	END;
END

Simula Language Guide

Simula is a high-level, statically typed programming language designed for simulation and object-oriented programming. It introduced the concept of classes, objects, and inheritance, laying the foundation for modern object-oriented languages like C++ and Java.

Primary Use Cases

  • ▸Discrete event simulation
  • ▸Teaching object-oriented programming
  • ▸Modeling complex systems
  • ▸Research in programming languages
  • ▸Historical study of software engineering paradigms

Notable Features

  • ▸Classes and objects for abstraction
  • ▸Inheritance for code reuse
  • ▸Coroutines for concurrent simulation
  • ▸Strong static typing
  • ▸Integrated simulation constructs (processes, events, queues)

Origin & Creator

Simula was developed in the 1960s by Ole-Johan Dahl and Kristen Nygaard at the Norwegian Computing Center (Norsk Regnesentral) to support simulation of complex systems.

Industrial Note

Simula is primarily used in academia and research, particularly for simulation modeling and teaching object-oriented programming concepts.

More Simula Typing Exercises

Simula Counter and Theme ToggleSimula Random Number GeneratorSimula Todo ListSimula Dice RollerSimula Countdown TimerSimula Temperature ConverterSimula Shopping CartSimula Name GreetingSimula Stopwatch

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher