Visual Programming Lab Manual: Make Sure You Have Dotnet Framework 4.5 Is Installed You Can Download It From
Visual Programming Lab Manual: Make Sure You Have Dotnet Framework 4.5 Is Installed You Can Download It From
LAB#1
OBJECTIVES:
THEORY:
To run a C# programs we need to install Microsoft Visual Studio IDE. The following
screenshots will guide you the installation steps of MS VS 2019, you just need to follow
the instructions on the screen. Other versions of MS Visual studio are also available,
therefore, students are encouraged to install and practice lab stuff on ms studio of their
choice.
1
VISUAL PROGRAMMING LAB MANUAL
You will be asked for permission to continue. Click on Yes to continue with the
installation.
Next, you will be asked to accept the software License terms and Privacy Statement.
Click on continue to go ahead with the installation.
2
VISUAL PROGRAMMING LAB MANUAL
The Installer will ask for the features you wish to install. You have four options here:
• Workloads
• Individual Components
• Language Packs
• Installation Location
Select Workloads
The first option is to select workloads. A workload is a group of individual components
based on the project type. For Example, if you are developing using ASP.NET for web
development then you can choose ASP.NET and web development workload which will
install the following components for you:
3
VISUAL PROGRAMMING LAB MANUAL
4
VISUAL PROGRAMMING LAB MANUAL
operating system. You can change it from this Tab.
The final tab is the installation location. Change the location if you wish to
Step7: Installation
5
VISUAL PROGRAMMING LAB MANUAL
Now, click on the Install button to begin the installation of Visual Studio 2019.
The installer will now download each component from the internet and starts the
installation. This will take a while depending on your internet speed. Once the
installation is complete, you will be presented with the Installation succeeded message
along with the option to register.
If you are installing Visual Studio for the first time you will be asked to sign in
Registration
Next, Sign in window appears, you can Sign in or click on Sign up to create a new
account.
In case if you wish to continue without Signing in click on “Not now, maybe later”
and proceed.
You can sign in later from the option Help -> Register Product.
Part2: Getting started with Visual Studio 2019 and setting up IDE environment for C#
applications
After completing the installation process you need to run the visual studio and set the
6
VISUAL PROGRAMMING LAB MANUAL
environment for c# application by following the steps mentioned below.
2. In the “start page” of Microsoft Visual Studio .NET, choose new project
The .NET environment adds some code pertaining to namespace, which is not
7
VISUAL PROGRAMMING LAB MANUAL
necessary for the 1st and simple program. Therefore, let’s modify it so that you are
aware of the essentials of a basic C# program. See Figure given below.
6. You can rename the class name, to anything you which, by right clicking on
“Class1.cs”, in the “Solution Explorer” frame and clicking on “rename”. When you do this
you must also delete “Class1” in the code view to whatever you called the class. See
Figure.
8
VISUAL PROGRAMMING LAB MANUAL
7. Now add the following code in the “Main” method Console.WriteLine(“This is my first
C# program!”); At this point, the class should look like as it does in Figure.
9
VISUAL PROGRAMMING LAB MANUAL
10
VISUAL PROGRAMMING LAB MANUAL
1. Write a program to that displays your name and roll no 10 times on separate line.
2. What is the role of comment in any programing language and how will you add
comments in your first program.
Comments are used to comment any line that is uncompible by compiler ,is used to put some info about
code and compiler does not compile that code.
12
VISUAL PROGRAMMING LAB MANUAL
In order to implement the user interface in console applications, Microsoft provided us with a class called
Console. The Console class is available in the “System” namespace. This Console class provides some
methods and properties using which we can implement the user interface in a console application
13
VISUAL PROGRAMMING LAB MANUAL
Name:
Roll #:
Date:
Remarks
( Subject Teaacher)
14
VISUAL PROGRAMMING LAB MANUAL
15
VISUAL PROGRAMMING LAB MANUAL
Remarks:
16