We are working with Cambridge Assessment International Education towards endorsement of this title. Any references or material related to answers, grades, papers or examinations are based on the opinion of the author(s). 1 Visual Studio Community
Although it is much more complex than we will need, it is possible for Solutions to contain many modules and linked files. Solution Explorer provides a complete view of the files in a project and can be used to add or remove files and to organise files into subfolders. Remember, Visual Studio can be used for large commercial projects and Solution Explorer is very helpful in those types of project.
LE
1.5 Make your first program using console application
When the console application is first loaded the code window will contain four lines of code.
P
Module Module1 Sub Main() ... End Sub End Module
TIP
M
Modules contain code and can hold a number of subroutines that perform specific actions. You will learn more about subroutines in Chapter 7. Sub Main() is the entry point for the program, and End Sub indicates the end of the subroutine. Code written between these points will be executed when the application is run. You can use the Enter key to add additional lines.
Do not change the name of the module Module1 or the subroutine Main( ). These are the module and subroutine that the project will run when it is executed. If the module or subroutine does not exist, the project will not run.
A
Our first program will display the text ‘Hello World’. You need to code the application to display the required text. This is the code we will be using. The explanations are in the steps below.
S
Module Module1 Sub Main() Console.WriteLine("Hello World") Console.ReadKey() End Sub End Module
KEY WORDS
subroutine: subroutines provide an independent section of code that can be called from another routine while the program is running. In this way, subroutines can be used to perform common tasks within a program. execute: in Computer Science, the term ‘execute’ means the operation of a computer program. When a computer program is in operation it is being executed. The term ‘run’ is also used to describe the same process. The ‘program is running’ or the ‘program is being executed’ both mean the same thing.
7 Original material © Cambridge University Press 2021. This material is not final and is subject to further changes prior to publication.