01092006
CHAPTER 4
We went over the handout which has the summarization of Fall 05.
These are the things I teach:
Visualization with JAVA, HTML & C++,
https://www.paypal.com/us/cgi-bin/webscr
Perl is a language which is similar to C, or C++. Most of the languages are C
based language.

Add to the cart
cart = 0
while true
if selection then
currentselectionprice
and if
cart=cart+currentselectionprice
end while
below is the sample template for "add cart"
we are reading from the book chapter 4 and comparing from the
make sure you read every summary, every introduction and conclusion. Every chapter has case study which is your assignment.
my friend is a chess champ
CHAPTER 4
Decision Making: making programs intelligent

why is the chess champion lose the game. its because of IF statement. There is an example on top.
In Visual Basic, decision making is done by using an If ..switch…Then…Else or a Select Case statement. The If...then…Else statement uses the general form shown in Figure 4.1.


Figure 4.3c—if value of candidateinitial is equal to H then increment the counter named
hc by the value of one (1) and assign the value back to hc. If the value of
candidateinitial is anything other than H, then add one to the value of the counter named
oc and assign the value back to oc.
|
Common Value Comparisons of If Expression
|
|
|
equality = |
not equal <> |
|
less than < |
Less than or equal <= |
|
greater than >
|
greater than or equal >= |
The result of the expression can be either true or false. In VB anything beside zero is considered to be true. Therefore, the number zero is false and any other number is true. The expression if can be made more complex when making several evaluations or even an assignment statement.
Assignment page 100 Chapter 4
What is an algorithm?
Loop with a input control the following program will stop the loop when users cancel the input box.
Dim hw As Integer Dim empid As String Dim hr, gp, np, taxrate, taxamt As Singleempid = InputBox("EMPLOYEE ID")
While empid <> ""hw = InputBox("Hours Worked")
hr = InputBox("Hourly Rate")
gp = hr * hw
MsgBox("Employee Id " & empid)
MsgBox("Hours Worked " & hw)
MsgBox("Hourly Rate is $" & hr)
MsgBox("Gross Pay is $" & gp)
If gp > 1000 Thentaxrate = 0.3
ElseIf gp > 800 Thentaxrate = 0.2
ElseIf gp > 500 Thentaxrate = 0.1
Else : taxrate = 0.0 End Ifempid = InputBox("EMPLOYEE ID")
End While