Skip to content

Programs

Building a solid mental model is important as you start to learn to program. The panorama gives you an overview of the concepts and how to think about them as you start on this part of the journey.

In terms of your mental model, one of the first things to grasp is the overall thing you will build: the program.

A program from the outside is a file that someone can run. Inside, a program is a sequence of instructions that get the computer to perform some actions.

Here is an illustration showing the code for a program.

Code for an example program

Example

This program contains a sequence of instructions that read in the user’s name and output a customised welcome message.

// This is where the program start!
// Use the methods in the SplashKit library
using static SplashKitSDK.SplashKit;
// Output a message
WriteLine("Welcome to sequence and data!");
string name;
Write("Please enter your name: ");
name = ReadLine();
WriteLine("Hello, " + name + "!");
WriteLine("Good bye!");