Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Questions on Introduction to Computer Programming Visual Basic - Assignment 2 | CS 0004, Assignments of Computer Science

Material Type: Assignment; Class: INTRO COMPUTER PROGRMMNG-BASIC; Subject: Computer Science; University: University of Pittsburgh; Term: Spring 2008;

Typology: Assignments

Pre 2010

Uploaded on 09/02/2009

koofers-user-0pf-1
koofers-user-0pf-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download Questions on Introduction to Computer Programming Visual Basic - Assignment 2 | CS 0004 and more Assignments Computer Science in PDF only on Docsity! Written Homework 2 02/14/2008 Due: 02/21/2008 Chapter 4 Procedures and Functions 1. What is the difference between a sub procedure and a function? 2. What does it mean for a function argument to be passed by value (ByVal) (how does it differ from pass by reference (ByRef))? 3. What is the difference between a Class-level variable and a local variable? 4. List three advantages of using sub procedures and functions. Chapter 5 Decision Making (If Blocks) 5. What will be the output of the following code? Dim maxNum As Double = 100 Dim numPresent As Double = 105 If numPresent > maxNum Then txtDisplay.Text = “Fire Code Violation, kick” & (maxNum-numPresent) & “People out!” Else txtDisplay.Text = “OK” End If Chapter 6 Loops (Going in circles) 6. What will be the output in the ListBox (lstDisplay) after the following code has been executed Dim startPoint As Integer = 1 Dim endPoint As Integer = 10 Dim counter As Integer For counter = startPoint to endPoint step 2 lstDisplay.Items.Add(2 &”x”& counter &” = ”& 2*counter) Next Chapter 3.4 Strings 7. Consider the following code; what will be the value of the string variable strVar after the code is executed?