Current Semester
Spring 2009
YU Links
Prior Semesters
Fall 2008
Spring 2008
Fall 2007
Spring 2007
Fall 2006
Spring 2006
Fall 2005
Fall 2002 - Spring 2005

INF1030: Introduction to Information Technology - (Homework)

Section 231 (Wilf campus)

HW1, due M Jan 29th

To submit the following HW, zip up the entire project folder and submit it to HW1 folder on the Lessons tab in Angel


First VB Program

Finish the project that we did together in class. The project was to create a program that contains two different buttons and one textbox. When the user clicks on the first button two different messsage boxes are displayed. Use the following code to display a Message box. Note that the entire line of code must be typed on a single line in the VB editor.:

MessageBox.Show("Your message goes here")

When the user clicks on the 2nd button yet another messagebox should be displayed. Finally, each time the user types a character into the textbox, a messagebox should be displayed that says "you typed a key" (or something similar).

HW2, due W Jan 31, 2007

To submit the following HW, zip up the entire project folder and submit it to HW2 folder on the Lessons tab in Angel


Re-create the HelloWorldAgain project.

HW3
Due: Monday Feb 5, 2007

To submit the following HW, zip up the entire project folder and submit it to folder named "Radius Area Circumference Program" on the Lessons tab in Angel


Formulas For Area and Circumference of a Circle

Given a circle with radius, r:

  • the formula for the area of the circle is: pi * r ^ 2 (Note: r ^ 2 means r squared)
  • the formula for the circumference of the circle is: 2 * pi * r
The Assignment

Create a program that asks the user to enter the radius of a circle. The program should then display the area and circumference of the circle. You may use the value of 3.14 as an approximate value of pi.

HW4
Due: Wednesday Feb 7, 2007

To submit the following HW, zip up the entire project folder and submit it to folder named "Swapping Values with a Variable" on the Lessons tab in Angel. (NOTE: I gave a similar assignment to my midtown class - you can look at their assignment if you like. The user interface is the same for your assignment and for theirs but their assignment was to multiply, not to add (see below). Make sure to do your assignment, not theirs.)


Create a program that allows the user to enter numbers into 3 different text boxes. When the user presses a button, the values in the textboxes should change as follows:

  • The value in the first textbox should be replaced with the value from the third textbox
  • The value in the 2nd textbox should be replaced with one more than the value which was originally in the first textbox
  • The value in the 3rd textbox should be replaced with one more than the value which was originally in the 2nd textbox

HINT: You will need to use at least one variable.

For example if the following were the original values

  • First textbox: 10
  • Second textbox: 20
  • Third textbox: 30

After pressing the button once, the new values should be

  • First textbox: 30
  • Second textbox: 11
  • Third textbox: 21

After pressing the button a 2nd time, the new values should be

  • First textbox: 21
  • Second textbox: 31
  • Third textbox: 12

etc ...



To submit the following HW, zip up the entire project folder and submit it to Angel


Write a program with the following user interface:

When the user clicks on Button1 and Button2 NOTHING SHOULD BE DISPLAYED.

When the user clicks on the button, "Count # of Clicks", a message box should be displayed that shows the following information

  • The number of times that the user clicked on Button1
  • The number of times that the user clicked on Button2
  • The total number of times that the user clicked on either Button1 or Button2

When the user clicks on the "Reset Count" button, nothing should be displayed, but the counts should go back to zero

EXAMPLE:

User clicks on Button1 twice, then on Button2 once, then on the button, "Count # of Clicks"

User then clicks Button2 three more times and then clicks on the button, "Count # of Clicks"

User then clicks the "Reset Counts" button and then clicks on the button, "Count # of Clicks"

User then clicks on Button1 once, then on Button2 once, then on the button, "Count # of Clicks"

HW5
Due: M Feb 26, 2007

To submit the following HW, zip up the entire project folder and submit it to Angel


CREATING THE VB PROJECT

The purpose of this assignment is for you to get used to entering code with nested if/elseif/else statements.

Create a new VB project with the following interface:

The user of the program enters a number and presses the button. A series of different MessageBoxes will then be displayed. The contents of the message boxes depend on what number the user entered.

The code for the button's click handler can be seen by cliking here. The name of the button in the project is btnDoit and the name of the textbox is tbNum. IMPORTANT: When you type in the code, make SURE that you press ENTER after each time that you type the words THEN and ELSE. If you don't then VB will format the code in a different way than we learned about.

QUESTIONS

What messages boxes will be displayed when the user enters the following numbers?

  • 1
  • 3
  • 40
  • 55
  • 72
  • 73
  • 74
  • 81
  • 100
  • 200

Make sure that you are able to figure out the answers by just looking at the code. To check your answers you may try running the program and see what you get.


Due: W March 14, 2007

Answer the following question. You do NOT have to submit the answer to Angel.


Question: Given the following code, what will the program display when the user clicks "Button1" ?

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim s As String
        Dim i, j As Integer
        j = 3
        For i = 2 To 4
            j = j + i * 2
            s = j.ToString() & j.ToString() & s
            MessageBox.Show(s)
        Next i
    End Sub

Due: M March 19, 2007
Submit the following to Angel.

Write a program that asks the user to enter a number. The program should then compute the sum of "N + N*(N+1)" where N loops from 1 through the number that the user entered. For example, if the user enters the number 4 then the program should compute the following value and display the result (i.e. 40):

(1*2) + (2*3) + (3*4) + (4*5)

=40