Skip to content
VUBuddy

CS411 Final Term Past Paper Updated Mar 2022 by Rao Bilal

Visual Programming PDF 813 KBUpdated 23 Oct 2026
Final term past paper CS411 Final Term Past Paper Updated Mar 2022 by Rao Bilal PDF 813 KB
vubuddy.com
Type
Final term past paper
Course
CS411 Visual Programming
Size
PDF 813 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 813 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 32. Download the file for all 32 pages.

Q No 1. What is the code of “for loop” to add the n even number in JavaScript?

<script type="text/javascript"> function sum()

var n,i, sum = 0; n = parseInt(document.getMyProgram ("first").value); for (i = 1; i < = n; i++)

if(i%2 == 0)

sum = sum+i;

document.get< MyProgram ("num").innerHTML =" Sum of " +n+ " even natural numbers is :"+sum;

</script>

Q No 2. What are the five types of HTML? 5 marks

Five types of html in use:

  •  HTML 4.01 Transitional
  •  HTML 4.01 Strict
  •  XHTML 1.0 Transitional
  •  XHTML 1.0 Strict
  •  HTML5

Q No 3. How to define binary resource and what are the categories of binary resources in WPF? 3 marks Binary resources are what rest of .net framework considers a resource. To define a binary resource, add a file and set the build action resource or content (loose file). Binary resource has two categories Binary resource can be embedded to assembly Binary resource can be loose file that may or may not be known at compile time. It can be localizable or not.

Q No 4. Write the properties of touch point in C#. 3 marks

The properties of Touchpoint are Position, Size, Bounds, touchdevice, Action (Down, Up, Move).

Q No 5

What will be the output of the code.

Async void displayprimecounts() · For (int i = 0; i < 10; i++) · Console.writeline(await getprimescountasync(i) } 5 marks

It is a code for UI program that remains responsive with a cpu bound task. In the given codes we have used for loop. When the first call of getprimecounts is given then control will be returned and remaining code will go in continuation. We have called await from inside the for loop. Because i is also captured and is available in the continuation, so i will also be incremented in each iteration. We will move onward from await when getprimescountasync is finished and at that time we resume as just returned from await expression.

Q No 6 Create a single instance application using WPF. 5 marks

Single instance application means that it should be run only one time.

Bool mutexisnew; Using (System. Threading. Mutex m = New System. Threading. Mutex(true, uniquename, out mutexisnew))

If (mutexisnew) // This is the first instance. Run the application. Else // There is already an instance running. Exit!

Q No 7 Write the XAML code to create a list box with three items. 5 marks

<listbox xmlns=“ <listbox. Items> <listboxitem Content= “Item 1”/> <listboxitem Content= “Item 2”/> <listboxitem Content= “Item 3”/> </listbox. Items> </listbox>

Q No 8 What is the purpose of Block in Objective-C. 3 marks

Blocks are a language-level feature added to Objective-C, which allow you to create distinct segments of code that can be passed around to methods or functions as if they were values. Blocks are Objective-C objects, which means they can be added to collections like NSArray or NSDictionary.

Q No 9 Define the Data template using XAML? 3 marks

Data template is a bit of XAML that describes how bound data is displayed. A data template can contain elements that are each bound to a data property along with additional markup that describes layout, color and other appearance.

Q No 10 Differentiate between Get and Post Method. 3 marks

In GET method, values are visible in the URL. In POST method, values are not visible in the URL. GET has a limitation on the length of the values, generally 255 characters. POST has no limitation on the length of the values since they are submitted via the body of HTTP. GET results can be bookmarked. POST results cannot be bookmarked. GET Parameters remain in web. In Post Parameters are not saved in web. Get method supports only string data types. Post This method supports different data types, such as string, numeric, binary, etc.

Q No 11 Define iOS language feature block also write its syntax. 3 marks

Block is a chunk of code that can be executed at some future time. Blocks are first-class functions, which is a fancy way of saying that Blocks are regular Objective-C objects. Since they're objects, they can be passed as parameters, returned from methods and functions, and assigned to variables. The syntax to define a block literal uses the caret symbol ( ^ ), like this:

^{ NSLog( "This is a block"); }

Q No 12. Write the difference between onetime binding and onewayTo Source binding. Also give example of both in XAML. In one time binding, control value is updated only when the application is initialized. This means you cannot change the value from source to control; as for changing the value, you have to write code in code behind file, so that you can change value from the back-end programming. In One way to source binding, target control updates the source control, which means if you change the value of the target control, it will update the value of the source control. It is just the opposite to One way binding.

one time binding Example

txtvalue. Text = "50"; mySlider. Value = Convert. ToInt32(txtvalue. Text);

One way to source binding Example

< TextBox Name="txtvalue" Text="{Binding ElementName=myCS411, Path=Value, Mode=One WayToSource, UpdateSourceTrigger=PropertyChanged}"> </TextBox>

Q No 13 Give the structure of protocols in Objective-C.

All CS411 files →
CS411 Visual Programming All CS411 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.