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
TIP
LE
Typing Imports System.Console at the start of the program means you won’t have to type console when you use the class: Imports System.Console Module Module1 Sub Main() WriteLine("Hello World") ReadKey() End Sub End Module
In this code, the Console class is imported at the beginning of the program. This means that rather than having to write Console. … for both lines of code in Sub Main(), you can just write the methods needed (in this case, WriteLine("Hello World") and ReadKey()).
Step 3
Start
or use F5 from the
P
To run the code, click the Start option on the toolbar
A
M
keyboard. This will launch the console window (Figure 1.7) and display the text ‘Hello World’. The execution of the code will be halted until a key is pressed, at which time the window will close.
Figure 1.7: Console window
S
While the console window is open, you may notice the Diagnostic Tools running in the background (see Figure 1.8). This provides information about the memory and CPU usage of the program being executed. While this is helpful when designing commercial projects, it is outside the scope of the syllabuses, and I usually shut the window.
9 Original material © Cambridge University Press 2021. This material is not final and is subject to further changes prior to publication.