Sunday, June 14, 2020

JavaScript Projects for Beginners


Javascript for Beginners sourceCode-

1. Print 0   to 10 by using for loop and while loop
IF you want to print 0 to 1o in descending order you can use loops .

Source code:


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
    function number(){
        // for(let i= 1;i<=10;i++){
        //     document.write("the nember is "+i+"<br>");
        // }
        let i=1;
        while(i<=10){
            document.write(`the new while number is ${i} <br> `);
            i++;
        }
    }
    number();
</script>
</body>
</html>


2. How to Print number in descending order in javascript?




Source Code: 


 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function dec(){
            for(let i = 10; i>=1;i--){
                document.write(`The number is ${i}<br>`)
            }
        }
        dec();
    </script>
</body>
</html>

3. Print Odd Number

Source Code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function odd(){
            for(let i = 1;i<=10;i+=2){
                document.write(`Method one with for loop ${i} <br>`);
            } 
            for(let k=1;k<=10;k++) {
                if(k%2!==0){
                    document.write(`Method two with for loop ${k} <br>`);

                }
            }
            //with while loop
            let j = 1;
            while(j<=10) {
                document.write(`Method one with while loop ${j} <br>`);
                j+=2;

            } 
            // print 1 to 10 only even number by mod method with for loop
       

   
        }
        odd();
    </script>
</body>
</html>



4.  Print Even Number


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //50 -100 even
        function even(){
            for(let i= 50;i<=100;i++){
                if(i%2==0){
                    document.write(`Then even number is ${i}<br>`)

                }
               
            }
        }
        even();
 
    </script>
</body>
</html>



5.  Print table of 3 by using for loop


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function tab(){
            let j= 3
            for(let i= 1;i<=10;i++){
                document.write(`${j} times ${i} is ${j*i}<br>`)
            }
        }
        tab();
    </script>
</body>
</html>


6. How to add or Sum in Javascript



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function total(){
            sum=0
            let array=[5,3,2,5,1]
            for(let i=0;i<array.length;i++){
                sum+=array[i]
            }
            document.write(`Total is ${sum}`);
        }
        total();
    </script>
</body>
</html>

7. Find smallest or Min number in Array in Javascript




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function minimum(){
            let array= [5,10,15,2,20,4]
            let min=array[0]
            for(let i = 0 ;i<array.length;i++){
                if(min>array[i]){
                    min= array[i]
                }
            }
            document.write(`The minimum value is ${min}`)
        }
        minimum();
    </script>
</body>
</html>

8. Find Largest or Max number in Javascript Array





<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function maximum(){
            let array = [5,4,2,6,10,1]
            let max= array[0]
            for(let i=0;i<array.length;i++){
                if(array[i]>max){
                    max= array[i]
                }
            }
            document.write(`The largest element in array is ${max}`)
        }
        maximum();
    </script>
</body>
</html>

9. Find Average in Javascript Array


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function avg(){
            let sum= 0;
            let array= [1,2,3]
            for(let i= 0;i<array.length;i++){
                sum+=array[i]
            }
            document.write(`The average is ${sum/array.length}`)

        }
        avg();
    </script>
</body>
</html>

Wednesday, May 6, 2020

Java Mini projects | Easy Small Projects for beginners


Java programs for Beginner-  If you are beginner in Java and want to learn java with Fun way here are some projects/ java problem for beginner. You have given java problem, Solution with explanation and we have added solution video. 
Looping Java Problem
1. Print 1  to 100 by using For and While Loop.  
Solution: we have to to break down small parts. Here are three things 
 Printing and its solution is System.out.println, starting point which is 1 and Ending point which is 100. And we have to add number by 1 .

                                                Code

public class LoopC {

public static void main(String[] args) {

//   Print 1 to 100 ------


// ----------------------For Loop-------------------

for(int i=1;i<=100;i=i+1){
System.out.print(i);
}
// --- ---------------------with while loop-----------------------
int i= 1;
while(i<=100){
System.out.println(i);
i++;
}

}

}

                                      Solution Video For Problem 1


------------------------------------------------------------------------------------------------------------------------

2. Print 1  to 20  Odd Number by using For and While Loop.  

Solution: Since we are printing number from 1 to 20 , out starting number will be 1 and Ending would be 20. Only new thing is odd number so will use i=i+2 instead of i=i+1.  see below code. 
                                                     Code

public class LoopC {

public static void main(String[] args) {

// ------- Print 1 to 20  Even Number -----

// --------------------------For Loop-----------------------
for(int i=1;i<20;i=i+2){
System.out.println("This is odd "+i);

}

// ------------------While loop----------------------
int i= 1;
while(i<20){
System.out.println("odd number "+i);
i=i+2;
}

}


}

                                       Solution video
----------------------------------------------------------------------------------------------------------------------
3. Print 1  to 20  Even Number by using For and While Loop.  

Solution: Since we are printing number from 1 to 20 , out starting number will be 1 and Ending would be 20. Since we want Even number we will start with 2,  and will use i=i+2 .

public class LoopC {

public static void main(String[] args) {
// TODO 
// Print 1 to 20  Even Number 
//----------------For Loop 

for(int i =2;i<=20;i=i+2){
System.out.println("my number is Even "+i);
}
// -------While Loop

int i = 2;
while (i<=20){
System.out.println("my number is Even "+i);
i=i+2;
}


}


}
  
                                                       Solution Video


----------------------------------------------------------------------------------------------------------------------
4. Print 1 to 10  in Descending order. For Ex- 10, 9, 8.....1

Solution : Since it is Descending order Our starting point is 10 and Ending point will 1. Also due to Descending order , decr. will be i--(which is same as i = i-1)
Code


public class LoopC {

public static void main(String[] args) {


// Print 1 to 10  in Descending order. For Ex- 10, 9, 8.....1
//-------------------For Loop 
         for(int i=10;i>=1;i=i-1){

System.out.println("this is Des "+i);
}


// --------------While Loop
int i= 10;
while(i>=1){
System.out.println("this is Des "+i);
i--;

}



}


}
                                            Solution in video
-------------------------------------------------------------------------------------------------------------------------

5. Print Sum of 1 to 10  
Solution: For print 1 to 10 as we know how to print it. but if we want to add sum of all number . we declare sum as variable as zero, now as soon as I will increase we will add to sum and it will loop or repeat untill it will reach to 10;
                                                              Code
-------------------------------------------------------------------------------------------------------------------------
public class LoopC {

public static void main(String[] args) {



// ---------------For Loop
int sum= 0;
for(int i = 1;i<=10;i++){
sum= sum+i;
System.out.println("Sum is "+sum);
}

//-----------------While Loop
int wsum= 0;
int i =1;
while(i<=10){
wsum=wsum+i;
System.out.println("Sum is "+wsum);
i++;

}

}

}
                                                                     Solution video

----------------------------------------------------------------------------------------------------------------------
6. ---------Print Table of 5 by using For loop and while loop
Solution :; Here we are printing table of 5 so we declare variable and store 5 in it. rest of is easy, we loop through as multiply 5 by i ,soevery time i , increase we are doing multiplication .                                                 
                                                                    Code
public class LoopC {

public static void main(String[] args) {




int multi= 5;
for(int i= 1;i<=10;i++){
System.out.println("5  *"+ i +" = "+multi*i);
}

int mul= 5;
int i = 1;
while(i<=10){
System.out.println("5  *"+ i +" = "+mul*i);
i++;
}

}
}
                                                          Solution video


---------------------------------------------------------------------------------------------------------------------
7. Ask  name from User , print it , Ask Question to user, take input from user , validate and print

Solution: We ask question by System..out.println("What is your name?"),For user input we need scanner class also we have to import class. After taking value from user we store in variable and print it. we ask second question and again we take answer from user , and that answer we validate and provide response accordingly, Please see below code, and for more info please watch solution video.

                                                                    Code

import java.util.Scanner;

public class Input {

void newInput(){
System.out.println("What is your name?");
Scanner s = new Scanner(System.in);
String  ns= s.next();
System.out.println("Hello "+ns);
System.out.println("Longest River in the world?");
String ans= s.next();
System.out.println("Your answer "+ans);
if(ans.equals("Nile")){
System.out.println("Good Job!!! ");
}
else {
System.out.println("Sorry your answer is not correct ");
}

}

public static void main(String[] args) {
Input in= new Input();
in.newInput();


}

}

                                                 Solution Video
------------------------------------------------------------------------------------------------------------------
8. Given Array Find Number is Positive , Negative Number
here you need for loop and use if to check condition in loop
Code

public class PoNe {
//Given Array Find Number is Positive , Negative
void myArray(){
int [] num = new int[3];
num[0]=10;
num[1]=0;
num[2]=-10;
for(int i = 0;i<3;i++){
if(num[i]>0){
System.out.println(num[i]+" is Positve");
}
else if(num[i]<0){
System.out.println(num[i]+" is Negative");
}
else {
System.out.println(num[i]+" is Zero");

}
}
}


public static void main(String[] args) {

PoNe p = new PoNe();
p.myArray();


}

}


9. How to print all the odd number in descending order?
First printnumber in decending order, then add if statement and add odd number condition

public class Number { void oddNumberDescendingOrder(){ for(int i = 10; i>=1;i--){ if(i%2==1){ System.out.println(i); } } } public static void main(String[] args) { Number n= new Number(); n.oddNumberDescendingOrder(); } }

Wednesday, December 25, 2019

Indian Girl Name | Hindu Girl Name Start with V

Indian Girl NameName is the recognition of person . In this post you will find Indian girls name which is in trend. Some of Indian Girl name in Sanskrit yet it is modern. Indian Girl  Name start with V fall under Vrushabh(Taurus) rasi In this post you will not only find Indian Girl name but also you will find meaning of name



Number     Name           Meaning
1                Vasudha        Earth
2                Vanita            Woman
3                Varsha           Rain
4                Vyakhya        Definition
5                Varidhi           Ocean
6                Vikhyati         Popular
7                Vishakha       Star
8                Vikrami         Record Holder
9                Viral              Precious
10              Vibhuti          Divine Power
11              Vihangi         Free bird
12              Vibha            Sun Light
13              Vidhi             Goddess of Destiny
14              Vidhya         Knowledge
15              Vrushti         Rain
16              Vaidehi        Goddess Sita
17              Vaishali        Ancient City
18              Vaijanti        The garland of victory

Indian Girl Name | Hindu Girl Name Start with T

Indian Girl Name- Girl Name character start with T is fall under Tula rashi (Libra )Modern Indian girls name  is trend now a days. In this blog you will not only find Indian girl name but also you will find meaning of Indian  Girl Name with T
Number  Name              Meaning
1             Tanu                    Delicate
2             Tanushri              Beautiful
3             Twisha                 Ray of Sunlight
4               Twara                Hast
5               Trupti                State of being satisfied
6               Tara                  Star
7               Tarika               Star
8               Tulsi                  Holy Plant
9               Trusha              Thrust
10             Tejal                  Shine
11             Tejshri               With divine power 
12             Toral                  Folk Heroine
13             Trishla               Mother of Lord Mahavir
14             Triveni               Place where three river meets



Indian Girl Name | Hindu Girl Name Start with S

Indian Girl Name- Girl Name character start with S is fall under Kumbh rashi (Aquarius)Modern Indian girls name  is trend now a days. In this blog you will not only find Indian girl name but also you will find meaning of Indian  girl Name with S
Number          Name                Meaning
1                      Sarita                    River
2                      Saloni                   Beautiful
3                      Samidha               Offering for a sacred fire
4                      Sapna                   Dream
5                      Svikruti                  Acceptance
6                      Smriti                    Remembrance
7                      Swara                   Sound
8                      Stuti                      Prayer
9                      Swati                    Star
10                    Sneha                   Love
11                    Sandhya               Evening
12                    Sahita                   Collection
13                    Sanjana                Polite
14                    Sanskriti               Culture
15                    Sarika                   Bird
16                    Sushmita              Happy
17                    Surbhi                  Cow
18                    Srushti                  World
19                    Sejal                     Water of River
20                    Sonam                  Beautiful
21                    Saumya                Pearl
22                    Shakha                 Branch
23                    Shalini                   Modest  
24                    Shivani                  Goddess Parvati
25                    Shivangi                Beautiful
26                    Shital                    Cold
27                    Shubhangi            Beautiful
28                    Shubhra                Name of River Ganga
29                    Shaili                     Tradition
30                    Sweta                    White
31                    Shraddha               Faith
32                    Shri                        Goddess Laxmi
33                    Shruti                     The smallest interval of                                                             pitch

34                    Shreya                    Best

Indian Girl Name | Hindu Girl Name start with R with meaning

Indian Girl Name- Girl  Name character start with R is fall under Tula rashi (Libra )Modern Indian girl name  is trend now a days. In this blog you will not only find Indian girl name but also you will find meaning of Indian  Girl Name with R
Number     Name                             Meaning
 1               Rati                                 Love
2                Ramya                            Beautiful
3                Raksha                           Protection
4                Rachna                           Create
5                Rajshri                            Sage like king
6                Ragini                             Raga
7                Radha                             Success, Prosperity
8                Radhika                          To Be Merciful
9                Riya                                 Singer
10              Richa                               Mantra from Veda
11              Riddhi                              Wealthy
12              Riti                                   Cultural Norms
13              Rupali                              Beautiful
14              Rupal                               Beautiful
15              Ruchi                               Desire
16              Rutu                                 Season
17              Rutika                              Garden of Flowers
18              Reva                                Name of Narmada River
19              Revthi                              Wealth
20              Roshni                             Light
21              Rochna                            Beautiful Woman
22              Rohini                              Star
  

java switch statement | Java Tutorial For Beginners

 Switch statement is alternative and more cleaner way to write code if we have more than two options. we can use else if, this is better way...