You are on page 1of 6

Mid-Term Exam (Take-Home) Fall - 2020

Subject: Visual Programming Languages Submission Day: Saturday


Instructor: Sophia Ajaz/ Qazi Shahab/ Asif Ali Submission Date: 28-11-2020
Program: BS (CS) / BS (SE) Time Allowed: 1 Week No.
of Students: 346 Max. Marks: 25

Faculty of Engineering, Sciences and Technology

Instructions:

1. Upload your project in a zipped file containing the Visual Studio Project Solution before
the due date on BlackBoard.

2. The zipped solution should contain a Word File also where you write your name and
registration ID on the first page and then attach the screenshots of the running project as
well as of your complete code class by class or any other answers.

3. Answer scripts can be uploaded on BlackBoard any time before its deadline.
Therefore, do not wait for the last hour to avoid any unforeseen problems.

4. Submission of answer copy(ies) will be considered acceptable through BlackBoard


only. Therefore, do not submit your document through email or any other medium.

5. Use 12 pt. font size and Times New Roman font style along with 1-inch page margins.

6. Follow the requirements of solution submission and also the marking criteria while writing
your answers.

7. Provide relevant, original and conceptual answers, as this exam aims to test your ability to
examine, explain, modify or develop concepts discussed in class.

8. Do not copy answers from the internet or other sources. The plagiarism of your answers
may be checked through Turnitin.

9. Recheck your answers before the submission on BlackBoard to correct any content or
language related errors.

Page 1 of 6
10. Double check your solution before uploading it on BlackBoard to ensure that you
have uploaded the correct file with your answers.
Question [25 Marks]

Michael Lewis owns a private firm Michael Association Pvt. Ltd in the United States
which is recently shifted from Hong Kong. He has noticed that his employees are not able
to persuade the clients in a proper manner during the meetings.
He wants his employees to learn frequently used expressions which will help them sound
more natural when speaking to native speakers of English. He believes that every
language has its own collection of wise sayings. They offer advice about the values of a
given culture or society. These combinations of words have (rarely complete sentences) a
"figurative" meaning.
He wants to hire you as a Visual Programmer to develop an application Special English
Book composed of Idioms and Phrases.

• First of All, justify why to use .NET Framework to build this application in your
own words.

The requirements of the application provided by the firm are given below:

• Special English Book must provide minimum fifty English idioms along with their
meanings.

• Special English Book must provide minimum fifty English phrases along with their
meanings.

• English phrases have three different categories.

o Proverbs o
Phrases verb
o Slang

So it means, minimum fifty English phrases are distributed among three different
categories altogether.

• It is required that the data of the application (Idioms & Phrases) must be saved
using appropriate data structure(s) that you select based on the knowledge of the
Generic Collections used in the .NET Framework.

• An option for the user to Add new data items (Idioms & Phrases) to the existing
records.

• An option for the user to Update existing data items (Idioms & Phrases).

Page 2 of 6
• An option for the user to Delete previous data items (Idioms & Phrases) to the
existing records.

• An option for the user to View all the data items (Idioms & Phrases) to the existing
records.

• Build smart and intuitive User Interface using windows forms. Being the Visual
Programmer of this application, the design is also in your hands at the moment.

• Make appropriate Model Classes for all types of data items or Abstract Classes
wherever required.

• Usage of C# Concepts is mandatory in the application which is based on your


understanding. Here, the impressions that you use according to the scenario will be
tested.

• The application must be able to gracefully handle the improper interactions of the
user.

Solution Marking Criteria:

Functionality Marks
Justification to use .NET Framework 2
Usage of Generic Collections 7
Suitably utilizing various C# Concepts 8
Exception Handling 3
Windows Forms (User Interface) 5

Solution:

Question:
1. Justification to use .NET Framework
2. Usage of Generic Collections
3. Suitably utilizing various C# Concepts
4. Exception Handling
5. Windows Forms (User Interface)

Page 3 of 6
Sol:
1. Justification to use .NET Framework
Microsoft .NET is the best platform for building robust, secure, and versatile web or desktop
applications. Utilized by a majority of Fortune 500 organizations, Microsoft .NET is mainstream
for large scale applications.

Microsoft .NET offers various favorable circumstances to the both developers and customers.
While customers get completely utilitarian and highlight rich applications with natural client
experience, engineers and architects get adaptability and dynamic highlights to fabricate sites
with ease. The .NET framework is a repository of immense number of shared code. This
arrangement of shared code has made the lives of engineers a lot simpler and spared their
quality time as they don't compose the total code over and over, rather center around the code
remarkable to their application

 Better UI Controls
 Security
 Integration with other Microsoft Applications
 Solidness and Scalability
 MVC Architecture
 Quick Deployment

2. Usage of Generic Collections

Generic is a class which permits the client to characterize classes and strategies with the
placeholder. Generics were added to variant 2.0 of the C# language. The fundamental thought
behind utilizing Generic is to permit type (Integer, String, … and so forth and client characterized
types) to be a boundary to strategies, classes, and interfaces. An essential impediment of
assortments is the nonappearance of viable kind checking. This implies that you can place any
object in an assortment since all classes in the C# programming language stretch out from the
item base class. This trade offs type security and repudiates the fundamental meaning of C# as
a kind safe language. Moreover, utilizing assortments includes a huge presentation overhead as
verifiable and express sort projecting that is needed to add or recover objects from an
assortment.

Utilizing generic collections gives you the programmed advantage of type wellbeing without
getting from a base vtype and actualize type-explicit individuals. Nonexclusive collections types
likewise by and large perform in a way that is better than the relating non-generic collections
types (and better than types that are gotten from non-generic base collections types) when the
assortment components are esteem types, on the grounds that with generics, there's no
compelling reason to box the components.

At the point when you want Immutability functionality in your application, the
System.Collections.Immutable namespace offers nonexclusive collection types you can utilize.
The entirety of the unchanging assortment types offer Builder classes that can advance
execution when you're playing out different changes. The Builder class clumps activities in a
changeable state. At the point when the sum total of what transformations have been finished,
call the ToImmutable strategy to "freeze" all hubs and make a permanent nonexclusive
assortment, for instance, an ImmutableList<T>.

The Builder article can be made by calling the nongeneric CreateBuilder() strategy. From a
Builder occurrence, you can call ToImmutable(). In like manner, from the Immutable* assortment,

Page 4 of 6
you can call ToBuilder() to make a manufacturer case from the nonexclusive changeless
assortment.

3. Suitably utilizing various C# Concepts

Writing a program in the C# language is like writing in the traditional C++ language. In the event
that you know about the C++ language its simple you to compose and comprehend C# Code.
C#.Net "Net" shows that C# is utilized to develop just Distributed Applications however utilizing
C# we can build up any sort of programming applications including Windows applications.

Compiling and Executing the Program

The above Program can be composed utilizing any content tool like scratch pad, editplus, vi
editor(in Linux) and so on, or we can utilize the Visual Studio's .NET IDE (Integrated
Development Environment) planned by Microsoft particularly to compose, assemble and execute
the .NET viable dialects. C# is one of the .NET viable dialects; the other viable .NET dialects are
VB.NET, J# and so forth

There are two different ways of assembling C# Program.

On the off chance that you compose this Program in Visual Studio's .NET IDE, at that point there
is no extra work to do to aggregate and execute the application. Simply use work key F5 or go to
the <Debug> Menu and select <Start Debugging>. The IDE inside consents and executes the
application with no client communication.

In this technique we physically aggregate and execute the above application utilizing the
Command Prompt. Presently open your order brief (Start->Run->cmd or order). You can arrange
the program by basically utilizing the C# compiler Tool (csc.exe)

At the point when you press the <Enter> Key this csc.exe device will accumulate our application
named FirstCSProgram.cs and make an exe record with a similar document name, for example,
FirstCSProgram.exe.

The Opening blossom support ({) demonstrates to the compiler that the square is opened or
begun; it is like its utilization in the C++ programming Language. At the point when the compiler
experiences this initial support it will wrinkle another space on the stack memory where it will
proclaim the variable which is checked to that block just (in the following section I will clarify
about factors, announcing factors and their extensions) and distributing some memory from that
recently made space for that block. Like when the compiler keeps up n number of factors in
memory.

The software is partitioned into various little units called objects. The information and capacities
are worked around these objects. The data of the items can be access by the functions related
with that object. The elements of one item can get to the elements of another article. A class is
the center of any cutting edge Object Oriented Programming language, for example, C#. In OOP
dialects it is required to make a class for speaking to information. A class is an outline of an
article that contains factors for putting away information and capacities to perform procedure on
the information.

Page 5 of 6
4. Exception Handling

An exception is a problem that emerges during the execution of a program. A C# exception is a


reaction to an uncommon condition that emerges while a program is running, for example, an
endeavor to isolate by zero.

exception give an approach to move control starting with one piece of a program then onto the
next. C# special case taking care of is based upon four catchphrases: attempt, get, at last, and
toss.

try− An attempt block distinguishes a square of code for which specific exemptions is enacted. It
is trailed by at least one catch blocks.
catch− A program gets an exception with a special case controller at the spot in a program where
you need to deal with the issue. The catch watchword demonstrates the getting of an exception .
finally − The at last square is utilized to execute a given arrangement of articulations, if a special
case is tossed. For instance, in the event that you open a document, it must be shut if a special
case is raised.
throw− A program tosses a special case when an issue appears. This is finished utilizing a toss
catchphrase.

5. Windows Forms (User Interface)


Windows Forms is a UI framework for building Windows work area applications. It gives one of
the most gainful approaches to make work area applications dependent on the visual architect
gave in Visual Studio. Usefulness, for example, simplified situation of visual controls makes it
simple to fabricate work area applications. With Windows Forms, you grow graphically rich
applications that are anything but difficult to convey, update, and work while disconnected or
while associated with the web. Windows Forms applications can get to the nearby equipment
and document arrangement of the PC where the application is running.

In Windows Forms, a structure is a visual surface on which you show data to the client. You
usually assemble Windows Forms applications by adding controls to structures and creating
reactions to client activities, for example, mouse snaps or key presses. A control is a discrete UI
component that shows information or acknowledges information input.

Windows Forms contains an assortment of controls that you can add to structures: controls that
show text boxes, catches, drop-down boxes, radio fastens, and even website pages. In the event
that a current control doesn't address your issues, Windows Forms additionally underpins
making your own custom controls utilizing the UserControl class.

With the simplified Windows Forms Designer in Visual Studio, you can without much of a stretch
make Windows Forms applications. Simply select the controls with your cursor and spot them
where you need on the structure. The originator gives devices, for example, gridlines and wake
up lines to take the issue from adjusting controls. You can utilize the FlowLayoutPanel,
TableLayoutPanel, and SplitContainer controls to make progressed structure designs in less
time.

Page 6 of 6

You might also like