You are on page 1of 22

Visual Programming

Assignment

No. 1
Instructions:

Only Hand Written Assignment is accepted

No late submission is allowed

Cheating is not allowed

Last Date is: Before or on the Day of Mid Visual Programming Paper
Answer the following Questions.

Question# 1 Define the following terms

a. .Net Framework
b. Framework Class Library
c. .Net Common Language Runtime
d. namespaces in .Net
e. Assembly
f. Common Language Specification
g. Common Intermediate Language
h. Visual Programming
i. Use of keyword new in C-Sharp
j. Structured Programming, Object Oriented Programming, Procedural Programming,
Visual Programming, Event Driven Programming Languages
k. List down five languages in each of the language categories given in Q#1 Part-j.
l. Why static is used with Main() method in Program.cs file?
m. How C# differs from Java
n. When was .Net Framework first launched?
o. What .Net Framework is currently in the Market?
p. What is event?
q. What is property?
r. Why namespace is used in C#?
s. Why the System Class library is used in C#

Question# 2 why the following files are used in .Net applications (window and web application)

a. app.config
b. web.config
c. Program.cs

Also, discuss the contents which can be added to each of these files.

Question# 3 what are the difference between windows and web applications?
Question# 4 what are the differences between JAVA and C-Sharp language?

Question# 5 what are the qualities of good project (Window or Web based)?

Question# 6 What is the function of using MSIL.

Question# 7 Differentiate between Console.Read() and Console.ReadLine()

Question# 8 What is a Console Application?

Question# 9 Differentiate between Console.Write() and Console.WriteLine()

Question# 10 Define the syntax of using

a. if statement
b. nested if-statement
c. if-else statement
d. nested if-else statement
e. switch statement
f. for loop
g. while loop
h. do-while loop
i. declaring and initializing one dimensional array
j. declaring and initializing two dimensional array
k. Design a class in C#, named ArrayHandlingInCSharp. Add the following methods
in the class and uses one dimensional Array:

a. readArrayItems() ------------------To read Values in the Array

b. showArrayItems() -------------------To display the Values stored in the Array

c. sortArrayItems() -------------------To sort the contents of Array using Bubble Sort

d. findMaximuminArray() ------------------To find maximum in Array

e. returnArrayItemsSum() ------------------To find and return the sum of Array Contents which
are Odd indexed
Overload the constructors in the above class. Finally, instantiate the class in Main () and
test the newly created class.

Question# 11 Give programming example of break and conditional operators in C-Sharp

Question# 12 What are command line arguments? How command line arguments are used.

Question# 13 What are Strings? How String Variables are declared in C-Sharp. Suppose
following text is stored in String Variable named intrToVisualCSharp.

Question# 14 How String array is declared? Declare an Array of size 50. Read the name of all
your class fellows in this array. Then using the built-in String class function. Write the C-Sharp
code to

a. Display all the names of the students which starts with letter S
b. Count all those names in the array which contains Khan in their name
c. Display all those Student Names which are having Rehman in their names
d. Find how many words are there in each name of the student

Question# 15

1. what is class?
2. How class is declared in C-Sharp?
3. How methods are overloaded in C-Sharp?
4. Design a class for Patient with Patient_Number, Patient_Name, Disease_Type instance
variables. Add methods for reading, displaying and searching data. Finally, instantiate the
class and test the class methods.

Question# 16

1. what is inheritance in C-Sharp?


2. Define the base and sub class?
3. How Inheritance is done in C#
4. Differentiate between Single and Multilevel Inheritance?
5. Does C-Sharp support Multiple Inheritance?
6. Design the classes to show the concepts of Single, Multilevel and Multiple Inheritance in
C-Sharp?

Question# 17 define the following terms with suitable programming examples

i. private, protected and public


ii. finalize
iii. partial class
iv. foreach loop in c-sharp
v. while and do-while loop

Question# 18 Explore the differences between .Net Framework 2.0, .Net Framework 2.5, .Net
Framework 3.0, .Net Framework 4.0 and .Net Framework 4.5.

Question# 19 what are Collection? Define ArrayList? What are various methods available for
ArrayList in C#.

Question# 20 How many programming languages are supported in .Net framework. List down
any 10 programming languages supported by .Net Framework

Question# 21Why the following Windows are used in Visual Studio

a. ToolBox Window
b. Solution Explorer
c. Property Windows
d. Output Window
e. Error List
f. Server Explorer

Question# 22 what is Visual Programming? List down any five Visual Programming Languages

Question# 23 List down ten control names from ToolBox and their important properties from

Question# 24 Find the short cut keys for

a. Opening Solution Explorer


b. ToolBox
c. Running a form
d. Opening the Error List
e. Opening the Server Explorer
f. Property Window

Question# 25 why the following controls are used? Define important properties of each of the
following controls

a. ToolTip
b. ProgressBar
c. NumericUpDown
d. LinkLabel
e. Timer
f. Color Dialog
g. VScrollBar
h. HScrollBar

Question# 26 Why message box is used in C#? Display Aslamo Alaikum in the Message Box?

Question# 27 Why the Form1_Load() event is used? When it is called? Which type of code is
usually given in the Form_Load() event

Question# 28 Design a Scientific Calculator in C# Windows application having basic arithmetic


as well as scientific operations like Sin, Cos, Tan, Log, Factorial etc.

Question# 29 Design a NotePad application in C# windows form, with the basic functionality of
Notepad that comes with Microsoft Windows

Question# 30 Why web browser control from ToolBox is used? Discuss its important properties
and Events?

Question# 31Differentitate between ListBox and ComboBox Controls. Write down their
important properties and Events.
Question# 32 Differentiate between MonthCalander and DateTimePicker Controls. Write down
their important properties and Events.

Question# 33 Differentiate between CheckBox and RadioButton Controls. Write down their
important properties and Events.

Question# 34 why the following C# controls are used, discuss their properties

a. Panel
b. FlowLayoutPanel
c. GroupBox
d. SplitPanel
e. TabControl
f. TableLayoutPanel

Question# 35 Discuss the following in C#

a. Delegates in C#
b. Interfaces in C#
c. Enum in C#
d. Stacks and Queue Collections in C#
e. Locking of Controls on Form1 Control
f. Which control is used for creating Menus in C#
g. Why MDI Parent form is used
Question# 35 Design a windows form which input First Name and Last name in two text
boxes and then full name should be displayed in third text box

Q# 36 Design the following simple Calculator in C# and write the code against each of the
buttons
Q# 37 Design the following form using ListBox, TextBox , Label and a Button. When you press
the Add Country Name Button then the Country Name user entered in the TexBox must be
added to the ListBox as shown
Q# 38 Design the following form using ComboBox, TextBox , Label and a Button. When you
press the Add Country Name Button then the Country Name user entered in the TexBox must be
added to the ListBox as shown
Q# 39 Differentiate between ListBox and ComboBox

Q# 40 Design the following form using Radio Buttons, TextBox , Label and a Button. When you
press the Show Details Button then the User Name user entered in the TexBox must be displayed
in Message Box with the Gender selected Ensure at a time only Male or Female
option is available.
Q# 41 Design the following form using CheckBoxes, TextBox , Label and a Button. When you
press the Show Details Button then the User Name user entered in the TexBox must be displayed
in Message Box with the hobbies selected by the user
Q# 42 Design the following form using DateTimePicker, TextBox , Label and a Button. When
you press the Age (In Years Months and Days) Button then age is displayed in the Textboxes
in Years Months and Days

Q# 43 Create a Digital Clock in C# as shown


Q# 44 Create a Splash Screen in C# using ProgressBar Control and Timer Control

Q# 45 Q Design a form Such that it look like this and perform the Calculator Operations

according to button being clicked

This is a sample scientific calculator. Code the form and copied all the code in word file.

Q# 46 Design a form as shown here and perform the String Operations as labelled on each

Buttons
You can user TextBox1 or TextBox2 Separately or combined where needed. The result of String

Operation should be displayed in TextBox3. E.g. in the output, user has entered the Saif Ur

Rehman Text in textbox1 and then he has pressed the Length button. So, operation performed

behind Length button was to count the Total Characters in the TextBox1 and result has been

displayed in TextBox3. Similarly, perform String Operation according to each button labelled in

the above Output Screen.

Q# 47 Design a Search form for the Table

tblCustomer(CustomerSID, CustomerName, CustomerCell#, CustomerEmailId,

CustomerRegistraitonDate, Gender, CustomerAddress, CustomerPhoneNo, Status (Data type of

Status us Bit) )

The search criteria should be


Now, based on the Entries you have to Query database Table and fill in the Grid View. Note,

a. If user provide no Search Criteria, i.e. if all fields left empty and user click the Search

Button then all Record of Customer should be displayed in Grid View

b. If user enter just Name then your Query Where Clause should be executed for Name

based search only

c. When user enter From Date and To Date value, then all Customers should be filled in

Grid which have been registered between these two Dates.

d. You have to ensure that To Date is greater than the From Date

Q# 48 Design the Login form and Authenticate the user using Stored Procedure, if User exists in
database then show Message in MessageBox that you have been logged in to System
successfully.

Q # 49 Design a table named

tblCustomer(CustomerSID, CustomerName, CustomerCell#, CustomerEmailId,

CustomerRegistraitonDate, Gender, CustomerAddress, CustomerPhoneNo, Status (Data type of

Status us Bit) )

in database.
Then design a Form, to add following controls to it.

a. TextBox

b. Labels

c. Add five Buttons (Save, Update, Delete, New, Cancel)\

d. Radio Buttons for Status and Gender

Then, create Stored Procedures for

1. Insert Record to Database

2. Delete a Record from Database

3. Fill the data Grid view placed on Form using SELECT statement

4. Update an Existing Customer Record using SQL Update Statement

Finally, code behind the SAVE, Update, Delete, Search buttons on the C# window form to call

each stored procedure.

Q# 50 Design a form to show the use of the following Controls

a. TextBox1, but only Numeric Data can be entered to TextBox1

b. TextBox2, but only Capital Alphabet can be entered to TextBox2

c. TextBox3, but only Small Alphabet can be entered to TextBox3

d. Date in DataTimePicker1 should not be choosen less than your PC Date

Q# 51 Define/Describe each of the followings

a. DBMS and Type of DBMS


b. Differentiate between Tables and Views

c. Differentiate between Stored Procedures and Views

d. Differentiate between Primary Key and Foreign Key

e. Console Vs Window Application

f. Why Program.CS file is used in Window Application

g. Write the Connection of a Database EShopping (suppose this database is on your own

PC)

h. Why we use the following Controls in Window Applications. Define each control and

give programming examples

1. Button Control

2. Textbox Control

3. Label Control

4. Picture Box

5. Date Time Picker

6. Data Gridview

7. CheckBox

8. Masked Textbox

9. Numeric Updown

10. ToolTip

11. Check Box

12. Progress Bar

i. Which properties of are used To

1. Copy the Text from TextBox to string Variable


2. Know which Radio button has been clicked from a list of three Radio buttons

3. Change the name of the TextBox1 to txtStudentName

4. Change the Label Text at Run Time

j. How to open FORM2 when you click the button on FORM1. Write the syntax to open a

Form from other Form.

k. Define and Explain the purpose of each of the followings

1. SQLConneciton Class, Discuss each method of SQLConnection Class

2. SQLCommand Class, Discuss each method of SQLCommand Class

3. SQLDataAdapter Class, Discuss each method of SQLDataAdapter Class

4. SQLDataReader Class, Discuss each method of SQLDataAdapter Class

5. Dataset Class, Discuss each method of DatasetCass

6. Differentiate between Dataset and DataTable

7. Differentiate between Dataset and DataReader

8.

l. Suppose we have filled a Dataset from a Database Table tblEmp(EID,Ename,ECNIC).

You are required to write the code which tells how much records are there in Dataset

m. Explain MessageBox in C#. How you will know which Button has been clicked in

MessageBox

a. SQLConneciton Class, Discuss each method of SQLConnection Class

n. Write one line code to find the length of the Text Entered in a TextBox named txtCNIC

o. Write one line code to check whether TextBox named txtCNIC has text or it is empty

p. What are the advantages of using MDIParent in the Window Applicaitons

q. Write one line code to make an Array of TextBox of size 20.


r. Differentiate between Convert.ToInt32 and Convert.ToInt16

Q# 52 Your University want to manage student records, and you need to save these records in
database. You have a database named StudentManagementSystem, following attributes of a
student must be stored in database. (StudentId, StudentName, FatherName, DateOfBirth,
Address).

A. Write Code to Create Stored Procedure in database for Insertion of records .


B. Write C# code to insert records using Stored Procedure. (Write all steps in detail)
C. You must ensure that Student Name and Father Name must not be NULL and must be at
least 10 characters each. Finally, Date of Birth should be less than todays date and not
later than 1990.

Q# 53 Write a code to create Rich Text Editor using filing I/O Your application support txt, doc
files and open these files in your editor after that these files save in dynamic location using
different dialog box. Your application is able to cut copy bold functions if you open new editor
all data will be removed
Q # 54 In UIIT Online Job Portals applied many candidates and these records are save in
Database, Using Layered Programming and Stored Procedures Write a code only show those
records those have BSCS degrees, After that more filtration filter those records thy CGPA above
2.50and status is Not Verified these records show in another Data grid view

Q# 55 UIIT online admission form for New students apply online .Here following create new
user account form. The form is designed in Windows application you are not write any code
accordingly design
(A)
1) Write code when combo box is open get
data from Database .and bind this data in
combo box
2) At a time only one radio button box
selected. When cheek any radio button first
radio button unchecked
3) To Handle Server Side Validation Insert
data in Database using Stored Procedures
(B)
1) When data inserted conformation message
show DATA INSERTED, if click reset the
all field empty

Compiled and Prepared By

Saif Ur Rehman

Assistant Professor

University Institute of Information Technology

PMAS Arid Agriculture University, Murree Road Rawalpindi

More Lectures in PDF/Video can be downloaded on

www.aspuiit.blogspot.com

You might also like