Wednesday, October 1, 2014

IT FUNDAMENTALS (JSCRIPT)




HI BSIT 1-B!

We will meet next meeting, you need to finish your project - WEB BASED MINI QUIZ APPS, HOROSCOPE PROGRAM (all in html4.0 and javascript)

Please review these parameters , commands and stuff.

1. If and Else
1.1 else if (nested condition)

2.function() { }

3. Relational Operators = ( && - AND   || - OR)

3.1  = = comparison
3.2  > < greater than and less than symbol
3.3 = assignment

4. var (declaring a variable and Data types like Numbers , string, characters..)

5. Prompt - Input

6. document.write ( display output)

7. Alert ( Graphical users interface to display the output)

** FINISH your 4 pages  assignments
For every page you need to produce the CODE (Hand written, in bandpaper), DESIGN FOR THE PAGE(bandpaper) and (FLOWCHART)

So far we discussed the basic flowchart using the LINKS, TERMINAL(start and end), DECISION SUPPORT, INPUT AND OUPUT PROCESS.

**
TO DO (to be submitted next meeting. PLEASE provide flowchart,hand written.)suBMIT THIS NEXT MEETING

1. Write a program that will ask the user to enter his/her NAME, LASTNAME, COURSE AND SUBJECT

1.1 Function name is mydata()
1.2 If the subject = ="itfundamental" display the PHINMA LOGO (centered using document.write)
1.3 and display the Name, Lastname,course and Subject.
1.4 Otherwise display an animated sad face (use the document.write)

2. Write a code that will add 2 numbers (MINI CALC)

2.1 The name of the function is calc(), variables are add1,add2 and total
2.3. Use parseInt to compute the value. Ask the user to enter 2 numbers( provide to INPUT Process or two Prompt commands)

What is parseInt? (Review) Jscript function to  convert String to a numerical value.

example:

function test(){

var a1,a2,average

a1 = 85
a2 = 85

average = (parseInt(a1) / parseInt(a2))
alert( " Average is " + parseInt(average))  or document.write("average is " + " " + parseInt(average))

}

Explanation:: (ILONGGO MODE) "KUNG SA DIIN ANG VALUE SANG A1 IS 85, ANG 85
HINDI PA INA NUMERO SA JSCRIPT. DAPAT MA CONVERT INA SA NUMERICAL VALUE.

GANI ANG COMMAND NGA (PARSEINT(A1) -> GUINA CONVERT ANG A1 SA NUMERIC PARA ANG 85 MAGING NUMERO HINDI TEXT PARA MA DIVIDE SA PARSEINT(A2).

KUHA? SUMA TOTAL ANG AVERAGE =(A1/A2) GALING GUIN GAMITAN LANG SANG
PARSEINT PARA MA CONVERT ANG UNOD SANG A1 NGA 85 KAG A2 NGA 85 SA NUMERICAL VALUE PARA MA PRINT.

AMO MAN ANG (PARSEINT(AVERAGE) PARA MAKA DISPLAY SANG NUMERO"