The following AS/400 source code for the Cash Register
0001.00 PGM
0002.00 DCLF (D1599AA/CHNGMK) RCDFMT(SCREN1)
0003.00 DCL VAR(&USERID) TYPE(*CHAR) LEN(10) VALUE(*USER)
0004.00 DCL VAR(&CHAGAM) TYPE(*DEC) LEN(8 2)
0005.00 DCL VAR(&BIL100) TYPE(*DEC) LEN(4)
0006.00 DCL VAR(&CHAGAM1) TYPE(*DEC) LEN(8 2)
0007.00 DCL VAR(&BILL50) TYPE(*DEC) LEN(2)
0008.00 DCL VAR(&BILL20) TYPE(*DEC) LEN(2)
0009.00 DCL VAR(&BILL10) TYPE(*DEC) LEN(2)
0010.00 DCL VAR(&BILL05) TYPE(*DEC) LEN(2)
0011.00 DCL VAR(&BILL01) TYPE(*DEC) LEN(2)
0012.00 DCL VAR(&QUARTE) TYPE(*DEC) LEN(2)
0013.00 DCL VAR(&DIMES1) TYPE(*DEC) LEN(2)
0014.00 DCL VAR(&NICKLE) TYPE(*DEC) LEN(2)
0015.00 DCL VAR(&PENNIE) TYPE(*DEC) LEN(2)
0016.00 DCL VAR(&IN05) TYPE(*LGL) 0016.00 DCL VAR(&IN05)
TYPE(*LGL)
0017.00 DCL VAR(&IN03) TYPE(*LGL)
0018.00 RTVJOBA JOB(&USERID)
0019.00 CLEAR: /* IT WILL MAKE ALL THE FIELDS TO ZERO....*/
0020.00 CHGVAR VAR(&USERID) VALUE(' ')
0021.00 CHGVAR VAR(&CHAGAM) VALUE(0)
0022.00 CHGVAR VAR(&BIL100) VALUE(0)
0023.00 CHGVAR VAR(&BILL50) VALUE(0)
0024.00 CHGVAR VAR(&BILL20) VALUE(0)
0025.00 CHGVAR VAR(&BILL10) VALUE(0) 0025.00 CHGVAR VAR(&BILL10) VALUE(0)
0026.00 CHGVAR VAR(&BILL05) VALUE(0)
0027.00 CHGVAR VAR(&BILL01) VALUE(0)
0028.00 CHGVAR VAR(&QUARTE) VALUE(0)
0029.00 CHGVAR VAR(&DIMES1) VALUE(0)
0030.00 CHGVAR VAR(&NICKLE) VALUE(0)
0031.00 CHGVAR VAR(&PENNIE) VALUE(0)
0032.00 CHGVAR VAR(&IN05) VALUE('0')
0033.00 CHGVAR VAR(&IN03) VALUE('0')
0034.00 DISPLA:
0035.00 SNDRCVF
0036.00 IF COND(&IN03='1') THEN(GOTO CMDLBL(EXIT))
0037.00 IF COND(&IN05='1') THEN(GOTO CMDLBL(CLEAR))
0038.00 /***************** THIS IS THE LABEL FOR MAKER FOR $100 BILL****/
0039.00 LBL100:
0040.00 IF COND(&CHAGAM *GE 100) THEN(DO)
0041.00 CHGVAR VAR(&BIL100) VALUE(&BIL100 +1)
0042.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM - 100)
0043.00 GOTO CMDLBL(LBL100)0043.00 GOTO CMDLBL(LBL100)
0044.00 ENDDO
0045.00 /*****************************/
0046.00 LBL50:
0047.00 IF COND(&CHAGAM *GE 50) THEN(DO)
0048.00 CHGVAR VAR(&BILL50) VALUE(&BILL50 +1)
0049.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM - 50)
0050.00 GOTO CMDLBL(LBL50)
0051.00 ENDDO
0052.00 /******************************/
0053.00 LBL20:
0054.00 IF COND(&CHAGAM *GE 20) THEN(DO)
0055.00 CHGVAR VAR(&BILL20) VALUE(&BILL20 +1)
0056.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM - 20)
0057.00 GOTO CMDLBL(LBL20)
0058.00 ENDDO
0059.00 /***************************************/
0060.00 LBL10:
0061.00 IF COND(&CHAGAM *GE 10) THEN(DO)
0062.00 CHGVAR VAR(&BILL10) VALUE(&BILL10 +1)
0063.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM -10)
0064.00 GOTO CMDLBL(LBL10)
0065.00 ENDDO
0066.00 /********************************************/
0067.00 LBL05:
0068.00 IF COND(&CHAGAM *GE 5) THEN(DO)
0069.00 CHGVAR VAR(&BILL05) VALUE(&BILL05 +1)
0070.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM - 5)
0071.00 GOTO CMDLBL(LBL05)
0072.00 ENDDO
0073.00 /**********************************************/
0074.00 LBL01:
0075.00 IF COND(&CHAGAM *GE 1) THEN(DO)
0076.00 CHGVAR VAR(&BILL01) VALUE(&BILL01 +1)
0077.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM - 1)
0078.00 GOTO CMDLBL(LBL01)
0079.00 ENDDO 0079.
0080.00 /**************************************/
0081.00 LBL025:
0082.00 IF COND(&CHAGAM *GE 0.25) THEN(DO)
0083.00 CHGVAR VAR(&QUARTE) VALUE(&QUARTE +1)
0084.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM - 0.25)
0085.00 GOTO CMDLBL(LBL025)
0086.00 ENDDO
0087.00 /********************************************/
0088.00 LBL010: 0088.00 LBL010:
0089.00 IF COND(&CHAGAM *GE 0.10) THEN(DO)
0090.00 CHGVAR VAR(&DIMES1) VALUE(&DIMES1 +1)
0091.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM - 0.10)
0092.00 GOTO CMDLBL(LBL010)
0093.00 ENDDO
0094.00 /**************************************************/
0095.00 LBL005:
0096.00 IF COND(&CHAGAM *GE 0.05) THEN(DO)
0097.00 CHGVAR VAR(&NICKLE) VALUE(&NICKLE +1) 0097.00 CHGVAR VAR(&NICKLE) VALUE(&NICKLE +1)
0098.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM - 0.05)
0099.00 GOTO CMDLBL(LBL005)
0100.00 ENDDO
0101.00 /*********************************/
0102.00 LBL001:
0103.00 IF COND(&CHAGAM *GE 0.01) THEN(DO)
0104.00 CHGVAR VAR(&PENNIE) VALUE(&PENNIE +1)
0105.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM - 0.01)
0106.00 GOTO CMDLBL(LBL001) 0106.00 GOTO CMDLBL(LBL001)
0107.00 ENDDO
0108.00 CHGVAR VAR(&CHAGAM) VALUE(&CHAGAM1)
0109.00 GOTO CMDLBL(DISPLA)
0110.00 /***************************************/
0111.00 EXIT:
0112.00 ENDPGM
0113.00 /************ END OF PROGRAM *********/
The Body Mass Index Source Code
<%@ Language=VBScript %>
<% option explicit %>
<%
Dim bmi,feet,inches,punds,kg,hightmeter,pundsbmi,kgbmi
Dim totinches,pndstokg,convert,kg1,lbs1,total,varkilos
feet=Request.Form("height") ' gets the feet
inches=Request.Form("inches") 'gets the inches
punds=Request.Form("pounds") 'gets the pounds
'''''''''''''''''''''''''Starting sub procedure finalBMIresult''''''''
Sub finalBMIresult
if Request.Form ("units") = "kilos" then
kg=Request.Form("kg") 'gets the kilograms
hightmeter=Request.Form("heightm") 'gets the highte in meter and centimeter
if (kg>0) then
bmi=(kg /(hightmeter*hightmeter)) ' the formual to get hte BMI for Kilograms
Response.Write(bmi)
end if
end if
'''''''''''''''''''''''''''''''''''
if Request.Form ("units") = "lbs" then
pndstokg=(punds*0.4536) ''converts pounds to kg
totinches=((feet*12)+inches) 'converts feet to inches and adds all the inches in variable
convert=(totinches*0.02540) '''''converts inches into meters
if (pndstokg>0) then
bmi=(pndstokg /(convert*convert)) ' formual to get the BMI in pounds
Response.Write(bmi)
end if
end if
end sub
''''''''''''''''''end of sub procedure finalBMIresult''''''''''''''''''''
''''''''''''''Starts the procedure badorgood'''''''''''
Sub badorgood
If (bmi>= 30.00) then
Response.Write("Danger of Dying!! Very Overweight oh no you may explode!!")
elseif (bmi >= 25.00) then
Response.Write ("You need to do some Work out")
elseif (bmi >= 20.00) then
Response.Write("This is perfet BMI for you will live very long.")
elseif (bmi >= 17.00) then
Response.Write("You are underweight. Eat litle more!!!")
else
Response.Write("It is way below your level You have to eat or you will die!!!!!")
End if
End Sub
''''''''''''''''''End what to do for their health'''''''''''''''''''''''''''''''''''''''''''''''
%>
This will give calculate your BMI;
The fallowing is the
ASP/Html Source code for the Guest book
<%@ Language=VBScript %>
<% option explicit %>
<%
const forAppending=8,ForReading=1,ForWriting=2
const TristateUsedefault=-2,Tristatetrue=-1,tristatefalse=0
dim strlogfilename
' this is the name of the file
strlogfilename="c:\Inetpub\wwwroot\write.txt"
' this is the file object - use this to acces the file
dim objlogfileFSO,objFile
set objlogfileFSO=CreateObject("Scripting.filesystemobject")
set objFile=objlogfileFSO.GetFile(strlogfilename)
' this creates a stream so you read from it and write to it.
dim objlogfileTS
if objlogfileFSO.fileexists(strlogfilename) then
'assifn the text stream to the fiel object
set objlogfileTS=objlogfileFSO.openTextFile(strlogfilename,ForAppending)
else
objlogfileTS=objlogfileFSO.Createtextfile(strlogfilename)
end if
''' SUB----------------------------------------------------
sub writetolog(strnewentry)
dim strlogentry
'strlogentry=FormatDateTime(Now)&"-" 'puts date time in front 9/13/2000
strlogentry=strlogentry & strnewentry ' time + yoru text
objlogfileTS.Writeline strlogentry
end sub
sub Closeit()
objlogfileTS.Close
end sub
'''''''''End of Sub----------------------
''''SUB-------------
''''''''''''''''''''''''''''''''''''''''''''''''''
sub readlog()
'write the code to read teh log file
Dim objfileteststream,strline
Set objfileteststream=objFile.openAsTextStream(ForReading)
Do while objfileteststream.AtEndofStream <> true
strline=objfileteststream.ReadLine
Response.write strline
Loop
objfileteststream.Close
end sub
%>
Please sign my guestbook
<%
dim name,email,coment
name=Request.Form("name")
email=Request.Form("email")
coment=Request.Form("coment")
Response.Write ("Thank you: " &name&" for signing my guestbook. I will store your e-mail: "&email& " at our database")
call writetolog(""&name&" | "&email&" | "&coment&" | ")
call closeit()%>
First Name |
Email |
Comments: |
Please view the rest of viewers who signed my
guestbook
<%call readlog()%>
If you whish you can look at the ASP Guest
Book
|