Mohammad Towhidul Islam

    16-Apr-15 09:13:35 am

    Creating Array of Objects in JavaScript

    <script> var o={}; o.name="jahid"; o.age="30"; var arr=[]; arr.push(o); o={}; o.name="Jone"; o.age="50"; arr.push(o); arr.push({'name':'Ridon','age':'34'}); a...

    Read More


    VCampus

    02-Apr-15 09:44:58 am

    JavaScript program to find largest number among three numbers

    Problem Definition Make JavaScript program to find largest number among three numbers. Code <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <!-- Step 1: Initialize largest=none Step 2: Read numbers...

    Read More


    VCampus

    02-Apr-15 09:36:37 am

    JavaScript program to determine if three numbers are consecutive

    Problem Definition Make a JavaScript program which will determine three numbers are consecutive. Code <script> var a=4,b=5,c=6; if(b==(a+1) && c==(b+1)){ document.write(a+","+b+","+c+" are consecutive"); }else{ document.write(a+",&...

    Read More


    VCampus

    02-Apr-15 09:26:26 am

    JavaScript program to print ascii patterns

    Problem Definition Write a JavaScript program which will print as the following ASCII patterns: a. * ** *** **** ***** ****** b. ***** **** *** ** * c. ***** ***** ***** ***** Code a. <script> for(i=0;i<5;i++){ for(j=0;j<=i; j++){ document.write("*&q...

    Read More


    Mohammad Towhidul Islam

    01-Apr-15 05:01:06 pm

    JavaScript program which takes a score and will print the grade

    Problem Definition Make a JavaScript program which takes a score and will print the grade as the following criteria: a. If score is greater or equal 90 and less or equal 100 than will print A b. If score is greater or equal 80 and less or equal 89 than will print B c. If score is greater or e...

    Read More


    Mohammad Towhidul Islam

    01-Apr-15 04:56:52 pm

    JavaScript program which will count how many is positive, how many negative and how many are zero numbers

    Problem Definition Make a JavaScript program which will count how many is positive, how many negative and how many are zero numbers for the following array: var data=[4,5,-4,-1,0,-8,0,45,9]; Code <script> var data=[4,5,-4,-1,0,-8,0,45,9]; var positive=0; var negative=0; var zero=0...

    Read More


    Mohammad Towhidul Islam

    01-Apr-15 04:50:35 pm

    JavaScript program to find smallest number, largest number and sum up array of numbers

    Problem Definition Find the smallest number, largest number and sum up all the numbers from the following array: var n=[4,5,67,3,45,74] Code <script> var n=[4,5,67,3,45,74]; var smallest=n[0]; var largest= n[0]; var sum=0; for(i=0;i<n.length;i++){ if(smallest>n[i]...

    Read More


    Mohammad Towhidul Islam

    01-Apr-15 04:15:02 pm

    JavaScript program which will take n input numbers and sum up

    Problem Definition Make a JavaScript program which will take n input numbers and sum up print the result all of input numbers when press 0 using do-while loop. Code <script> var total=0; var a=[]; do{ var n=parseInt(prompt("Enter a value:")); a.push(n); if(n==0)b...

    Read More


    Mohammad Towhidul Islam

    16-Mar-15 11:46:11 pm

    জাভাক্রিপ্ট : লেটারাল এবং ডাটা টাইপ

    লেটারাল: লেটারাল হচ্ছে ডাটা বা মান যা আমরা ভেরিয়েবল এ তা নির্ধারণ করতে পারি যেমন: 1. Number Literal var x=10 var x=63.34 এখানে 10 and 63.34 হচ্ছে Number লেটারাল, 2. Scientific Notations var x=3.56e+2; NB: The letter e is followed by a plus or minus sign and from one to three integers....

    Read More


    Mohammad Towhidul Islam

    04-Jan-15 05:47:55 pm

    Make your first javascript game tic tac toe

    <!DOCTYPE html> <html> <head> <title>Tic Tac Toe</title> </head> <body> <script> board=[ [0,0,0], [0,0,0], [0,0,0] ]; function resetBoard(){ for(i=0;i<3;i++) for(j=0;j<3;j++){ board[i][j]=0; docum...

    Read More


Copyright © 2024. Powered by Intellect Software Ltd