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

Practical C#

The document outlines a practical assignment due on March 31, 2025, consisting of multiple programming tasks related to Windows Forms applications and C#. Tasks include creating a text file reader/writer, manipulating arrays, designing dialog boxes, connecting to a MySQL database, and handling exceptions in console applications. Each question specifies requirements and marks allocation for the implementation of various programming concepts and functionalities.
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)
11 views2 pages

Practical C#

The document outlines a practical assignment due on March 31, 2025, consisting of multiple programming tasks related to Windows Forms applications and C#. Tasks include creating a text file reader/writer, manipulating arrays, designing dialog boxes, connecting to a MySQL database, and handling exceptions in console applications. Each question specifies requirements and marks allocation for the implementation of various programming concepts and functionalities.
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/ 2

DUE DATE 31 MARCH 2025

(In Class)

OOP PRACTICAL 2
QUESTION 1
Create a windows form application to create, write data inputted in a textbox and read from a
text file called subjects.txt. When the read button is clicked the text will be displayed in a
listbox as show below (Use StreamWriter and Stream Reader classes. 10 marks

label
Enter Text
Textbox

buttons Create

Write
listbox
Read

QUESTION 2
a) Write a program that creates and load an array of 10 integer’s numbers and display
the elements. The program will prompt the user to enter a specific integer to delete
from the array, display the remaining elements. 10
marks
b) Create an abstract class called "Shape" that has methods for calculating the area and
perimeter. Create concrete classes called "Rectangle", "square", and "Circle" that
extend the shape class and implement the area and perimeter methods. (10 marks)
c)
QUESTION 3

- X

OPEN Multiple textbox

SAVE

PRINT

FONT EXIT
Button
Design a windows forms application to implement the following common Dialog Boxes
.Uses the above interface.
i. OpenfileDialog
ii. saveDialog
iii. printDialog
iv. fontDialog 10 marks
DUE DATE 31 MARCH 2025
(In Class)
QUESTION 4

Create a table Product in MySql .Your table should have the following details
Product Number, name, unit Price.
Create a C# application and connect it to your database. Your application should have the
following buttons. Save, Exit .Add functionality to your buttons. 10 marks

QUESTION 5

a) Write a console program that adds and divides two integers entered by the user from
the keyboard using exception handling (division by zero is mathematically not
allowed) 10 marks
b) Use the sample interface below, write a program with a listbox contain names of
students .Add five students to the listbox at design time .The program should enable
the user to add more students at runtime via a textbox clear all students from the
listbox ,count the number of students in the listbox and display the result in a
messagebox as well as delete a selected student form the listbox 10 marks
List box
Textbox

Student Name

Add Student
John
Tindo
Delete Student Chipo
Munya
Melody
Count Items

Sort in Desc order

Clear list

You might also like