Shahezad Contractor
Dr. Ebrahimi

04/06/06

Why do we need a loop?

Why do we need data file?

Why do we need  if statements?

Why do we need input/output?

Why do we need variable?
Cells are like variable.  Neurons can be variables. 

A cell can only have 1 value at a time.

10

When you give a new value to a cell you lose the last value.  As human beings how do we forget?  One way to forget is to replace with a new value.  We have billions of these variables.  We have arrays.  We dynamically generate arrays.  The things we want to remember we refresh it.  If we want to forget something we repress it.

I want hours worked to be an array.  I need 10 rooms for hour worked.  Array comes from the word arrangement.

Array is a contiguous and homogeneous memory location identified by name.

Chapter 5

Hours Worked.

0

1

0

1

You can identify the room.  Hours worked.  Room 205 is here.  We're talking about inside.  We talk about how array is identical to a neuron or a cell.  What is inside the little hardware or the cell is the value.  Array is nothing new.  X means summation.  Summation of grades.  From i = 1 to 13.  The first popular useful programming language was called fortran.  Formula Translation.  That means that you want to make an array into a language.  How do you linearize or transfer that formula?

This is increment in VB.
i+=1
 

 

i=0
while (i<=13)
x(i) = inputBox ("How many people are in the room")
sum=sum+x(i)
i=i+1
end while

for i = 0 to 12

next i

How do you say x of i

In visual basic array and a function are written in the same way.

How many students are in this room?

+x(i) forget about programming.

Array is finished.  Use names that relate to the concept.  If  you're adding call it sum. 

 

FOR NEXT CLASS BRING QUESTION 2, 3.

 

Q2a)Design a form called Dr Ebrahimi payroll (instead put your own name). The form has three textbox labeled as EMPLOYEE’S ID, HOURS WORKED and HOURLY RATE. A button known as COMPUE GROSS PAY will compute the gross pay for the employee. The output will be display in a textbox labeled as GROSS PAY.

 

Q2b) Expand the above program to compute the employee’s tax amount. An input text box labeled as TAX RATE is to enter the tax rate for example (The default tax rate will be set in property to 0.30 for 30%). A button known as COMPUTE TAX AMOUNT will figure out the employee’s tax amount. The output will display in a text box labeled as TAX AMOUNT.

Extra credit- Instead of compute button use textchanged(  ) to compute the tax amount.

 

Q2c) Expand the above program to compute the net pay. A button known as COMPUTE NET PAY will compute the net pay. The output will be display in a text box labeled as NET PAY. 

Extra credit- instead of text box numbering such as textbox1.text use a proper name in the properties such as empid.text.

 

Q3A)Expand the above program to repeat for 5 employees. Declares all variables used in the program. Assign each input variable by inputbox (“PLEASE ENTER EMPLOYEE’S ID”). Assign value of each input variable to the respective text box. Similarly assign value of each output 

Variable to the respective text box. Only use one command button captioned as COMPUTE 5 EMPLOYEE.

Q3b) Display the employee counter by a msgbox at the end of each round in the loop or assign the value of the counter variable to a textbox labeled as COUNTER.

Q4c) loop the number of employees interactively by an inputbox. Assign the input value of the input box as a number of the employees. The program will loop depends on the entered value (6 or 10).

Extra credit- program should loop until a sentinel value is entered.

 Q3d) Expand the program to take all the data from the input file called employee.txt

 

 

Akibu, Hakeem O.  
Alagheband, Shadi Crystal  
Colon, Christen N. +2
Contractor, Shahezad M.  
Francoeur, Ralph J.  
Ghazanchyan, Farideh  
Guo, Sunli  
Halajian, Alishan A. +2
Hicks, Rory  
Nemati, Matthew  
Paul, My-Kerline +1
Saeed, Amna  
Saeed, Asma