Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //تشابتر4 ملف السويتش
- var grade = "PREMIUM";
- switch (grade){
- case "REGULAR":
- alert ("it is $3.15");
- break;
- case "PREMIUM":
- alert ("it is $3.35");
- break;
- case "DIESEL":
- alert ("it is $3.47");
- break;
- default:
- alert("THAT IS NOT VALID GRADE")
- }
- ==================================================================
- ///تشابتر 5 اول ملف
- function myfunction(){
- var a = 5;
- var b = 10;
- var c = 20;
- var d = a + b + c;
- alert("The value of d is: " + d );
- }
- myfunction();
- myfunction();
- myfunction();
- myfunction();
- myfunction();
- ==================================================================
- ///تشابتر 5 ثاني ملف
- function addTwoNumbers(a,b){
- var result = a + b;
- return result;
- }
- var x = addTwoNumbers(5,10);
- alert(x);
- addTwoNumbers(500,100);
- addTwoNumbers(7,-2323);
- ==================================================================
- ///تشابتر 6
- var amount =0;
- // create the index
- var i=0;
- // chick condition
- while (i<=10){
- amount = amount +100;
- //incremant index
- i++;
- }
- alert("the value is:" + amount);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement