0% found this document useful (0 votes)
13 views30 pages

List of Practical's

The document outlines the practical lab objectives and guidelines for BCA students, emphasizing the use of Visual Studio and various programming tasks in C#. It includes minimum system requirements, standard operating procedures, and a list of practical exercises such as creating Windows applications, demonstrating MATLAB functionalities, and performing image processing tasks. Students are expected to maintain discipline, submit lab records, and follow specific instructions during lab sessions.

Uploaded by

krushnadongare91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views30 pages

List of Practical's

The document outlines the practical lab objectives and guidelines for BCA students, emphasizing the use of Visual Studio and various programming tasks in C#. It includes minimum system requirements, standard operating procedures, and a list of practical exercises such as creating Windows applications, demonstrating MATLAB functionalities, and performing image processing tasks. Students are expected to maintain discipline, submit lab records, and follow specific instructions during lab sessions.

Uploaded by

krushnadongare91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

List of Practical’s

DEPARTEMENT OF BCA

1. Lab Objectives:
➢ Be able to download and install visual studio, or any other online compiler, and to
be execute windows programming practical.

➢Be able to understand the structure of visual studio and do the programs with their
proper syntax.

Introduction about lab


Upon completion of the course, students will be able to

➢ Perform operations with c programs in turbo, GDB compiler etc.

3.Introduction about lab


Minimum System requirements:

• 64-bit Microsoft® Windows® 8/10/11.


• x86_64 CPU architecture; 2nd generation Intel Core or newer, or AMD CPU
with support for a Windows Hypervisor.
• 8 GB RAM or more.
• 8 GB of available disk space minimum.
• 1280 x 800 minimum screen resolutions.
4.Guidelines to students

A. Standard operating procedure


The students will write the experiment in the Practical Record Book as per the
following format:

a) Name of the experiment

b) Aim

c) Writing the program

d) Signature of the Faculty

B. Guide Lines to Students in Lab


Disciplinary to be maintained by the students in the Lab

➢ Students are required to carry their record book with completed experiments while

entering the lab.

➢ Students must use the equipment with care. Any damage is caused student is
punishable ➢ Students are not allowed to use their cell phones/pen drives/ CDs in
labs.

➢ Students need to be maintained proper dress code along with ID Card

➢ Students are supposed to occupy the computers allotted to them and are not

supposed to talk or make noise in the lab. Students, after completion of each
experiment they need to be updated in observation notes and same to be updated in
the record.

➢ Lab records need to be submitted after completion of experiment and get it

corrected with the concerned lab faculty.

➢ If a student is absent for any lab, they need to be completed the same experiment in

the free time before attending next lab.


General laboratory instructions
1. Students are advised to come to the laboratory at least 5 minutes before (to the
starting time), those who come after 5 minutes will not be allowed into the lab.

2. Plan your task properly much before to the commencement, come prepared to the
lab with the synopsis / program / experiment details.

3. Student should enter into the laboratory with:

4. Sign in the laboratory login register, write the TIME-IN, and occupy the computer
system allotted to you by the faculty.

5. Execute your task in the laboratory, and record the results / output in the lab and
get certified by the concerned faculty.

6. All the students should be polite and cooperative with the laboratory staff, must
maintain the discipline and decency in the laboratory.

7. Computer labs are established with sophisticated and high-end branded systems,
which should be utilized properly.

8. Students must keep their mobile phones in SWITCHED OFF mode during the lab
sessions. Misuse of the equipment, misbehaviors with the staff and systems etc.,
will attract severe punishment.

9. Students must take the permission of the faculty in case of any urgency to go out;
if anybody found loitering outside the lab / class without permission during
working hours will be treated seriously and punished appropriately.
10. Students should LOG OFF/ SHUT DOWN the computer system before he/she
leaves the lab after completing the task (experiment) in all aspects. He/she must
ensure the system / seat is kept properly.

CLASS INCHARGE HOD PRINCIPAL


INDEX

Sr. No. Name of Practical Date Remark

1. W.A.P for demonstration of creating simple windows


application.

2. W.A.P for demonstration of Text Box & Button control, List Box
& Combo Box Control.

3. W.A.P for demonstration of designing Menus, dialog boxes.

4. W.A.P for demonstration of C# functions, Strings.

5. W.A.P for demonstration of Array, Jagged Array.

6. Demonstration of Matlab Environment, reading, displaying


images.

7. Demonstration of histogram Processing.

8. Demonstration of ID-DFT & its inverse.

9. Demonstration of frequency domain filtering.

10. Demonstration of color image representation.


1. Write a program for demonstration of creating
simple windows application.
Code: Simple Windows Application in C#
To create this program, you can use Visual Studio.
Steps to create a Windows Forms Application:
1. Open Visual Studio.
2. Create a new project and select Windows Forms App
(.NET Framework).
3. Add the following code to the form:
2. Write a program for demonstration of Text Box
& Button control, List Box & Combo Box
Control.
3. Write a program for demonstration ofdesifning
Menus, dialog boxes.

4. Write a program for demonstration of C#


functions, Strings.
using System;

class Program
{
static void Main()
{
Console.WriteLine("=== Function
Demonstrations ===");
FunctionDemo();

Console.WriteLine("\n=== String Operations


===");
StringOperations();
}

// Function Demonstration
static void FunctionDemo()
{
Console.WriteLine("Calling Add Function (5
+ 3): " + Add(5, 3));

Console.WriteLine("Calling Overloaded Add


Function (5.5 + 3.2): " + Add(5.5, 3.2));
Console.WriteLine("Calling Recursive
Factorial Function (Factorial of 5): " +
Factorial(5));
}

// User-defined Function: Addition


static int Add(int a, int b)
{
return a + b;
}

// Function Overloading: Addition for doubles


static double Add(double a, double b)
{
return a + b;
}

// Recursive Function: Factorial Calculation


static int Factorial(int n)
{
if (n == 0)
return 1;
return n * Factorial(n - 1);
}

// String Operations
static void StringOperations()
{
string str1 = "Hello";
string str2 = "World";
// String Concatenation
string result = str1 + " " + str2;
Console.WriteLine("Concatenation: " +
result);

// String Length
Console.WriteLine("Length of result: " +
result.Length);

// Substring
Console.WriteLine("Substring (Hello): " +
result.Substring(0, 5));

// String Comparison
Console.WriteLine("String Comparison (Hello
vs World): " + str1.CompareTo(str2));

// Convert to Upper Case


Console.WriteLine("Upper Case: " +
result.ToUpper());

// Convert to Lower Case


Console.WriteLine("Lower Case: " +
result.ToLower());

// Replacing a Word
Console.WriteLine("Replacing 'World' with
'C#': " + result.Replace("World", "C#"));
// Splitting String
string[] words = result.Split(' ');
Console.WriteLine("Splitting String:");
foreach (string word in words)
{
Console.WriteLine(word);
}
}
}

Output:
=== Function Demonstrations ===
Calling Add Function (5 + 3): 8
Calling Overloaded Add Function (5.5 + 3.2): 8.7
Calling Recursive Factorial Function (Factorial of
5): 120

=== String Operations ===


Concatenation: Hello World
Length of result: 11
Substring (Hello): Hello
String Comparison (Hello vs World): -1
Upper Case: HELLO WORLD
Lower Case: hello world
Replacing 'World' with 'C#': Hello C#
Splitting String:
Hello
World
5. Write a program for demonstration of Array,
Jagged Array.
Output:

=== One-Dimensional Array ===


Elements of 1D Array:
10 20 30 40 50

=== Two-Dimensional Array (Matrix) ===


Elements of 2D Array (Matrix):
123
456
789

=== Jagged Array ===


Elements of Jagged Array:
Row 1: 1 2 3
Row 2: 4 5
Row 3: 6 7 8 9

6. Write a program for demonstration ofMatlab


Environment, reading, displaying images.

Here's a simple C# program that demonstrates how to interact with the


MATLAB environment using the MATLAB Engine API for .NET. This
program launches MATLAB, executes a basic command, retrieves a variable,
and closes the engine.

Prerequisites:

1. Install MATLAB Engine API for .NET.


2. Ensure that MATLAB is installed on your system.
3. Add a reference to MathWorks.MATLAB.Engine.dll in your C#
project.
Prerequisites:

1. Install MATLAB Engine API for .NET.


2. Ensure MATLAB is installed on your system.
3. Add a reference to MathWorks.MATLAB.Engine.dll in your C# project.
4. Keep an image file (image.jpg) in a known directory.

using System;
using MathWorks.MATLAB.Engine;

class Program
{
static void Main()
{
Console.WriteLine("Starting MATLAB Engine...");

// Start MATLAB Engine


using (var matlab = MATLABEngine.StartMATLAB())
{
Console.WriteLine("MATLAB Engine started.");

// Specify the image path (change this to your actual image file)
string imagePath = @"C:\path\to\your\image.jpg";

// Send the image path to MATLAB


matlab.SetVariable("imagePath", imagePath);

// Read and display the image using MATLAB commands


matlab.Execute("img = imread(imagePath);");
matlab.Execute("imshow(img); title('Displayed from MATLAB');");

Console.WriteLine("Image has been loaded and displayed in MATLAB.");

// Keep MATLAB open for viewing


Console.WriteLine("Press any key to close MATLAB...");
Console.ReadKey();

// Close MATLAB Engine


matlab.Quit();
Console.WriteLine("MATLAB Engine closed.");
}
}
}

7. Write a program for demonstration of


histogram processing.

using System;
using MathWorks.MATLAB.Engine;

class Program
{
static void Main()
{
Console.WriteLine("Starting MATLAB
Engine...");

// Start MATLAB Engine


using (var matlab =
MATLABEngine.StartMATLAB())
{
Console.WriteLine("MATLAB Engine
started.");

// Specify the image path (Update this with


your actual image file)
string imagePath =
@"C:\path\to\your\image.jpg";

// Send the image path to MATLAB


matlab.SetVariable("imagePath",
imagePath);

// MATLAB commands to read and process


the histogram
matlab.Execute("img =
imread(imagePath);"); // Read Image
matlab.Execute("grayImg =
rgb2gray(img);"); // Convert to grayscale (if not
already)
matlab.Execute("figure; imshow(grayImg);
title('Grayscale Image');"); // Display Image
matlab.Execute("figure; imhist(grayImg);
title('Histogram of Image');"); // Display Histogram

Console.WriteLine("Image and histogram


have been displayed in MATLAB.");

// Keep MATLAB open for viewing


Console.WriteLine("Press any key to close
MATLAB...");
Console.ReadKey();

// Close MATLAB Engine


matlab.Quit();
Console.WriteLine("MATLAB Engine
closed.");
}
}
}
8. Write a program for demonstration of 1D-DFT
& its inverse.

using System;
using MathWorks.MATLAB.Engine;

class Program
{
static void Main()
{
Console.WriteLine("Starting MATLAB
Engine...");

// Start MATLAB Engine


using (var matlab =
MATLABEngine.StartMATLAB())
{
Console.WriteLine("MATLAB Engine
started.");
// Define a 1D signal (e.g., a sine wave)
double[] signal = { 1, 2, 3, 4, 3, 2, 1, 0 };

// Send the signal array to MATLAB


matlab.SetVariable("x", signal);

// Perform 1D Discrete Fourier Transform


(DFT)
matlab.Execute("X = fft(x);"); // Compute
FFT
double[] dftResult =
matlab.GetVariable<double[]>("X"); // Get result
from MATLAB

// Perform Inverse Discrete Fourier


Transform (IDFT)
matlab.Execute("x_reconstructed =
ifft(X);"); // Compute IFFT
double[] idftResult =
matlab.GetVariable<double[]>("x_reconstructed");

// Display the results


Console.WriteLine("Original Signal: " +
string.Join(", ", signal));
Console.WriteLine("DFT Result
(Magnitude): " + string.Join(", ",
Array.ConvertAll(dftResult, Math.Abs)));
Console.WriteLine("Reconstructed Signal
(IDFT): " + string.Join(", ", idftResult));
// Plot the results in MATLAB
matlab.Execute("figure; subplot(3,1,1);
stem(x); title('Original Signal');");
matlab.Execute("subplot(3,1,2);
stem(abs(X)); title('DFT Magnitude Spectrum');");
matlab.Execute("subplot(3,1,3);
stem(real(x_reconstructed)); title('Reconstructed
Signal via IDFT');");

Console.WriteLine("Plots have been


generated in MATLAB.");

// Keep MATLAB open for viewing


Console.WriteLine("Press any key to close
MATLAB...");
Console.ReadKey();

// Close MATLAB Engine


matlab.Quit();
Console.WriteLine("MATLAB Engine
closed.");
}
}
}
9. Write a program for demonstration of
frequency domain filtering.
using System;
using MathWorks.MATLAB.Engine;

class Program
{
static void Main()
{
Console.WriteLine("Starting MATLAB
Engine...");

// Start MATLAB Engine


using (var matlab =
MATLABEngine.StartMATLAB())
{
Console.WriteLine("MATLAB Engine
started.");
// Specify the image path (update it to your
actual image file)
string imagePath =
@"C:\path\to\your\image.jpg";

// Send image path to MATLAB


matlab.SetVariable("imagePath",
imagePath);

// MATLAB script for frequency domain


filtering
matlab.Execute(@"
img = imread(imagePath);
grayImg = rgb2gray(img); % Convert to
grayscale if needed
figure; imshow(grayImg); title('Original
Image');

% Compute 2D FFT
F = fft2(double(grayImg));
F_shifted = fftshift(F); % Shift zero
frequency to center
magnitude = abs(F_shifted);
figure; imshow(log(1 + magnitude), []);
title('Frequency Spectrum');

% Create a Low-Pass Filter


[rows, cols] = size(grayImg);
[X, Y] = meshgrid(1:cols, 1:rows);
centerX = cols / 2;
centerY = rows / 2;
radius = 30; % Cutoff frequency
lowPassFilter = sqrt((X - centerX).^2 +
(Y - centerY).^2) <= radius;

% Apply the filter in the frequency


domain
F_filtered = F_shifted .* lowPassFilter;

% Compute Inverse FFT


F_unshifted = ifftshift(F_filtered); %
Undo shift
img_filtered = abs(ifft2(F_unshifted));
figure; imshow(uint8(img_filtered));
title('Filtered Image');
");

Console.WriteLine("Frequency domain
filtering applied. Check MATLAB for images.");

// Keep MATLAB open for viewing


Console.WriteLine("Press any key to close
MATLAB...");
Console.ReadKey();

// Close MATLAB Engine


matlab.Quit();
Console.WriteLine("MATLAB Engine
closed.");
}
}
}

10. Write a program for demonstration of color


image representation.
using System;
using MathWorks.MATLAB.Engine;

class Program
{
static void Main()
{
Console.WriteLine("Starting MATLAB
Engine...");

// Start MATLAB Engine


using (var matlab =
MATLABEngine.StartMATLAB())
{
Console.WriteLine("MATLAB Engine
started.");
// Specify the image path (update this to
your actual image file)
string imagePath =
@"C:\path\to\your\image.jpg";

// Send the image path to MATLAB


matlab.SetVariable("imagePath",
imagePath);

// MATLAB script for color image


representation
matlab.Execute(@"
img = imread(imagePath);
figure; imshow(img); title('Original Color
Image');

% Extract RGB channels


R = img(:,:,1); % Red channel
G = img(:,:,2); % Green channel
B = img(:,:,3); % Blue channel

% Display individual color channels


figure;
subplot(2,2,1); imshow(img);
title('Original Image');
subplot(2,2,2); imshow(R); title('Red
Channel');
subplot(2,2,3); imshow(G); title('Green
Channel');
subplot(2,2,4); imshow(B); title('Blue
Channel');

% Reconstruct image from separate


channels
reconstructedImg = cat(3, R, G, B);
figure; imshow(reconstructedImg);
title('Reconstructed Image');
");

Console.WriteLine("Color image
representation applied. Check MATLAB for
images.");

// Keep MATLAB open for viewing


Console.WriteLine("Press any key to close
MATLAB...");
Console.ReadKey();

// Close MATLAB Engine


matlab.Quit();
Console.WriteLine("MATLAB Engine
closed.");
}
}
}

You might also like