[go: up one dir, main page]

0% found this document useful (0 votes)
29 views2 pages

Activity No.3.1

1. The document provides instructions for creating a "Hello World" program in Visual C# using Visual Studio 2019. It outlines steps to create a new C# console application project, add code to output "Hello World", and run the program. 2. The code sample demonstrates basic C# syntax like using namespaces, the main method, and Console.WriteLine to output text. It also includes comments to explain parts of the code. 3. The document provides tips on Visual Studio features like IntelliSense that provide auto-complete suggestions while coding.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

Activity No.3.1

1. The document provides instructions for creating a "Hello World" program in Visual C# using Visual Studio 2019. It outlines steps to create a new C# console application project, add code to output "Hello World", and run the program. 2. The code sample demonstrates basic C# syntax like using namespaces, the main method, and Console.WriteLine to output text. It also includes comments to explain parts of the code. 3. The document provides tips on Visual Studio features like IntelliSense that provide auto-complete suggestions while coding.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Name: _____________________________________ Grade and Section: 10 -___________________

TLE – ICT 10

ACTIVITY NO. 3.2: CREATE A VISUAL C# PROJECT

This time, you will start to use Visual C# in developing programs. To do this, follow these steps:

1. Launch Visual Studio 2019 and create a new project.


2. In the language and project type, choose C# and Console. Click on the Console App (.Net
Framework) option and then click Next.
3. Type “Act3.1 Hello World” as the file name and then click OK.
4. Your main IDE view in Visual Studio will have default written codes…
5. Replace the content of program.cs with the following code:
1. // A Hello World! Program in C#
2. Using system;
3. Namespace HelloWorld
4. {
5. Class Hello
6. {
7. static void Main()
8. {
9. Console.WriteLine(“Hello World”);
10.
11. // Keep the Console window open in debug mode.
12. Console.WriteLine(“Press any key to exit.”)
13. Console.ReadKey();
14. }
15. }
16. }
6. After keying the code, press F5 to run the project. A Command Prompt window will appear that
contains the line “Hello Word!”.

About the CODE:

The first line contains a comment. The characters // convert the rest of the line to a comment.

// A Hello World! Program in C#.

A comment can also be declared by a block of text, enclosing it between the /* and */ characters.

/* A Hello World! Program in C#.

This program displays the string “Hello World!” on the screen. */

The namespace is a collection of classes.

Namespace HelloWorld
A C# console application must contain a Main method where the program control starts and
ends. The main method is where the main program/process is written.

Static void Main()

The statement Console.WriteLine (“Hello World!”) uses the WriteLine method. WriteLine is one
of the output commands for the console class, which displays the string parameter followed by a new
line. Including the using System directive at the begging of the program also allows you to use input
and output operations.

For example: using System;

Console.WriteLine(“Hello World!”)

TIPS AND TRICKS:

Visual Studio has the IntelliSence feature that provides instant code completion while coding. It appears
whenever you start entering the syntax and displays options on how to complete the statement. This
also indicates that you are entering the correct syntax

After doing Activity 3.1, evaluate your personal assessment towards the completion of the
task. Just put a check.

Very Need
Skills Satisfactory or Satisfactory Improve
Excellent
My Work ensures the highest quality.
I used my time well throughout the task/s to
ensure things get done on time.
I always show a positive attitude about the
task/s.
I consistently stay focused on the tasks and
what needs to be done. I am very self-directed.
I always make sure that I have all the
materials/resources for the task/s.

You might also like