Tuesday, October 6, 2020

Java Code Example

 1. Encapsulation Example 

public class Employee {

private String name;

public String getData() {

return name;

}

public void setData(String name) {

this.name= name;

}

public static void main(String[] args) {

Employee ob =new Employee();

ob.setData("Sajib Kumar");

 System.out.print("My name "+ob.getData());

}

}

Output: My name Sajib Kumar

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

2. Abstraction Example

public abstract class Shape {
  abstract void draw();
}

class Rectangle extends Shape{
void draw() {
System.out.print("Rectangle is drawing");
}
}
class Circle extends Shape{
void draw() {
System.out.print("Circle is drawing");
}
}
class Testabstraction {
public static void main(String args[]) {
Shape obj = new Circle();
obj.draw();
}
}

Output
Circle is drawing

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

3.  Interface Example

public interface Shape {
  void draw();
}

class Rectangle implements Shape{
public void draw() {
System.out.print("Rectangle is drawing");
}
}
class Circle implements Shape{
public void draw() {
System.out.print("Circle is drawing!");
}
}
class Testabstraction {
public static void main(String args[]) {
Shape obj = new Circle();
obj.draw();
}
}

Output
Circle is drawing!

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

4. Inheritance Example

public class Shapes {
 void run() {
System.out.println("This is a Shape");
 }
}

class Rectangle extends Shapes{
void run() {
System.out.println("This is a Rectangle");
}
}

class TestInheritance{
public static void main(String args[]) {
Shapes obj = new Rectangle();
obj.run();
}
}

Output
This is a Rectangle
---------------------------------------------------

5. Run Time polymorphism (Method Overriding)

public class Shapes {
 void run() {
 System.out.println("This is a Shape");
 }
}

class Rectangle extends Shapes{
void run() {
 System.out.println("This is a Rectangle");
 }
}

class TestInheritance{
public static void main(String args[]) {
Shapes obj = new Rectangle();
obj.run();
}
}

Output
This is a Rectangle
------------------------------------------------------------------------------------

6. Complile Time polymorphism (Method Overloading)


public class Overloading {
 public int add(int a, int b) {
return a+b;
 }
 public int add(int a,int b, int c) {
return a+b+c;
 }
}

class Testverloading{
public static void main( String args[]) {
Overloading obj  = new Overloading();
System.out.println("First Sum "+obj.add(10,20));
System.out.println("Second Sum "+obj.add(10,20,30));
}
}

Output

First Sum 30
Second Sum 60

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

7. how to change the value of html element using HTML DOM

<!DOCTYPE html>
<html>
<head>
<title>Html Page</title>
</head>
<body>
  <h1>Text</h1>
  
  <button onclick="myfunc()" type="submit">Submit</button>
  <script>
  function myfunc(){
   document.getElementsByTagName('h1')[0].innerHTML = "New Text";
  }
  </script>
</body>
</html>


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

8. Binary to Decimal

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i;
    int arr[20];
    int n=20;
    for(i=0; n!=0; i++)
    {
        arr[i] = n%2;
        n = n/2;
    }
    for(i=i-1; i>=0; i--)
    {
        printf("%d",arr[i]);
    }
    return 0;
}

Output:10100 

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

9. Binary to Decimal

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i,sum=0,base=1,rem;
    int n=110;
   while(n!=0)
    {
        rem = n%10;
        sum = sum+rem*base;
        n = n/10;
        base = base*2;
    }
    printf("%d",sum);
    return 0;
}

Output: 6

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

10.  Binary Search

#include <iostream>

using namespace std;


int binarySearch(int arr[], int l, int r, int x)
{
    while(l<=r)
    {
        int m = l + (r - l) / 2;
        if(arr[m]== x)
        {
            return m;
        }
        if(arr[m] < x)
        {
            l = m+1;
        }
        else
        {
            r = m-1;
        }

    }
     return -1;
}
int main()
{
    int arr[] = { 2, 3, 4, 10, 40 };
    int x = 10;
    int n = sizeof(arr) / sizeof(arr[0]);
    int result = binarySearch(arr, 0, n - 1, x);
    if(result == -1)
    {
        cout<<"Not present"<<endl;
    }
    else
    {
        cout<<result<<endl;
    }
    return 0;
}

11.  Linear Search

#include <iostream>
using namespace std;
  
int search(int arr[], int n, int x)
{
    int i;
    for (i = 0; i < n; i++)
        if (arr[i] == x)
            return i;
    return -1;
}
  
int main(void)
{
    int arr[] = { 2, 3, 4, 10, 40 };
    int x = 10;
    int n = sizeof(arr) / sizeof(arr[0]);
    int result = search(arr, n, x);
   (result == -1)? cout<<"Element is not present in array" 
                 : cout<<"Element is present at index " <<result;
   return 0;
}

S.NOBFSDFS
1.BFS stands for Breadth First Search.DFS stands for Depth First Search.
2.BFS uses Queue data structure for finding the shortest path.DFS uses Stack data structure.
3Vertex-based algorithmEdge-based algorithm
4.BFS is better when target is closer to Source.DFS is better when target is far from source.
5.BFS is slower than DFS.DFS is faster than BFS.
6.Inefficient memory utilizationEfficient memory utilization

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


S.NO.ROUTERGATEWAY
1.It is a hardware device which is responsible for receiving, analyzing and forwarding the data packets to other networks.It is a device that is used for the communication among the networks which have a different set of protocols.
2.It supports the dynamic routing.It does not support dynamic routing.
3.The main function of a router is routing the traffic from one network to the other.The main function of a gateway is to translate one protocol to the other.
4.A router operates on layer 3 and layer 4 of the OSI model.A gateway operates upto layer 5 of the OSI model.
5.Working principle of a router is to install routing details for multiple networks and routing traffic based upon the destination address.5. Working principle of a gateway is to differentiate what is inside the network and what is outside the network.
6.It is hosted on only the dedicated applications.It is hosted on dedicated applications, physical servers or virtual applications.
7.The additional features provided by a router are Wireless networking, Static routing, NAT, DHCP server etc.The additional features provided by a gateway are network access control, protocol conversion etc.









Monday, October 5, 2020

Programming List

 Lab Test Tips and Suggestion(Maximum Case Analysis)

Number Problem
1.Prime Number
2. Conversion :i) binary to decimal ii) decimal to binary
3.Palindrome Number
4.Perfect Number
6.Fibonacci series
7. Factorial using recursion
8.Number reverse
9.Number replace between first and last position
10.GCD and LCD
11.Leap Year
12.Summation of series (different types)
13.Odd and even Number
14. Write a program that takes a five positive integer as input and find out the sum if the digits repeatedly until result is converged to a single digit.
Simple Input:
N=254189
Simple Output:
Sum of digits: 29 (First Step)
Sum of digits: 11(Second Step
Sum of Digits: 2 (Final Step)
15. Sorting (marge sorting, quick sorting)
String problem Problem
1.String reverse
2.Word count from a sentence
3.Check anagram
4.String sorting (asc or desc)
6.
i)Upper case to lower case or lower case to upper case (special position)
ii)camel case from a sentence
7.Count vowel,consonant,number,special symbol from a sentence.
8. check string s2 is superscript of string s1
Sample input :s1=x,s2=x^x
Output :Yes
9.String replace between first and last position
Array Problem
1.Find maximum,minimum and position from an integer array
2.Binary search algorithm
3. Sorting (marge sorting, quick sorting, bubble sorting)
3.Marge two integer type array and sorting(asc or desc)
Miscellaneous
1.Read a text file from particular location and show data
2.read,write and marge file.
3.Different pattern matching.
4.Check valid IP address.
5.Excel salary calculation(Logical formal like IF,concat etc).
Database:
1.Create a table and insert data using mysql
2.Query from existing table like maximum salary.
Development
1.Mysql connection, create table using PHP and MySql.
2.Design a form using html
sample
info(name, idno, designation and DOB)
and insert data into DB using this form.
3.Menu design using html
Tools
1.Code Block(preferable)
2. Netbeans (for java)
3.Xampp
4.Language:C(preferable),C++,java,php
Reference book
Cloud IT Solution Book
Lab- (page no 448 to 451)
Program C-(page no 349 to 383)
Reference Link
3. http://cbasicprogram.blogspot.com

Thursday, October 1, 2020

বিভিন্ন_পরিমাপক_যন্ত্রঃ


১.উচ্চতা পরিমাপক যন্ত্র-
অলটিমিটার;
-
২.সমুদ্রের গভীরতা নির্ণয়াক
যন্ত্র- ফ্যাদোমিটার
-
৩.ভূমিকম্প নির্ণয় করার যন্ত্র -
সিসমোগ্রাফ;
-
৪.ভূমিকম্পের তীব্রতা পরিমাপক
মাপার যন্ত্র- রিক্টার স্কেল;
-
৫.উড়োজাহাজের উচ্চতা মাপার
যন্ত্র -ওডোমিটার
-
৬.দিক নির্ণয়ন যন্ত্র- কম্পাস;
-
৭.সূর্যের কৌণিক দূরত্ব নির্ণয়ক
যন্ত্র- সেক্সট্যান্ট;
-
৮.শ্রবণ শক্তি পরীক্ষার যন্ত্র-
অডিও মিটার;
-
৯.হৃৎপিন্ডের গতি নির্ণয়ক যন্ত্র-
কার্ডিওগ্রাফ;
-
১০.বায়ুর চাপ নির্ণয়ক যন্ত্র-
ব্যারোমিটার;
-
১১.গ্যাসের চাপ নির্ণয়ক যন্ত্র-
ম্যানোমিটার;
-
১২.বায়ুর গতিবেগ নির্ণয়াক
যন্ত্র- ব্যারোমিটার;
-
১৩.সূক্ষ সময় পরিমাপক যন্ত্র-
ক্রনোমিটার;
-
১৪.তাপ পরিমাপক যন্ত্র-থার্মোমি
টার;
-
১৫.বৃষ্টি পরিমাপক যন্ত্র-
রেনগেজ;
-
১৬.দুধের বিশুদ্ধতা পরিমাপক
যন্ত্র- ল্যাকটোমিটার;
-
১৬.মানবদেহের রক্তচাপ নির্ণয়াক
যন্ত্র- স্ফিগমোম্যানোমিটার;
-
১৮.উদ্ভিদের বৃদ্ধি নির্ণয়ক
যন্ত্র-ক্রেসকোগ্রাফ
-
১৯.বায়ুর আদ্রতা নির্ণয়ক যন্ত্র-
হাইগ্রোমিটার;
-
২০.বাতাস/গ্যাসের ওজন/ঘনত্ব
নির্ণয়ক যন্ত্র- এ্যারোমিটার;
-
২১.উড়োজাহাজের বা মোটরগাড়ির
গতি নির্ণয়াক যন্ত্র-
ট্যাকোমিটার;

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

ক। সমুদ্রের দ্রাঘীমাংশ নির্ণায়ক যন্ত্র- ক্রেনোমিটার
খ। উড়োজাহাজের গতি মাপার যন্ত্র- ট্যাকোমিটার
গ। তরলের আপেক্ষিক গুরুত্ত্ব মাপার যন্ত্র- হাইড্রোমিটার
ঘ। ভুমিকম্পের মাত্রা নির্ণায়ক যন্ত্র- সিসমোগ্রাফ/সিসমোমটার
ঙ। ভূমিকম্পের তীব্রতা মাপা হয়- রিক্টার স্কেলে
চ। অক্ষাংশ নির্ণায়ক যন্ত্র- সেক্সট্যান্ট
ছ। দিক নির্ণায়ক যন্ত্র- কম্পাস
জ। মানুষের রক্তচাপ নির্ণায়ক যন্ত্র- স্ফিগমোম্যনোমিটার
ঝ। হৃৎপিন্ডের ও ফুসফুসের শব্দ নির্ণায়ক যন্ত্র- স্টেথোস্কোপ
ঞ। হৃৎপিন্ডের গতি নির্ণয়ের যন্ত্র- কার্ডিওগ্রাফ
ট। হৃৎপিন্ডের কর্মক্ষমতা ও রোগ নির্ণয় করআ হয়- ইকো কার্ডিওগ্রাফ
ঠ। ১ মিলিমিটারের ছোট বস্তুর দৈর্ঘ মাপা হয়- ভার্নিয়ার স্কেলে
ড। কোনকিছুর দৈর্ঘ মাপা হয়- মিটার স্কেলে

All Important Day

 ১০ জানুয়ারি ==> বঙ্গবন্ধুর স্বদেশ প্রত্যাবর্তন দিবস।

১৯ জানুয়ারি ==> জাতীয় শিক্ষক দিবস।
২০ জানুয়ারি ==> শহীদ আসাদ দিবস।
১৪ ফেব্রুয়ারি ==> সুন্দরবন দিবস।
২১ ফেব্রুয়ারি ==> শহীদ দিবস।
২৮ ফেব্রুয়ারি ==> জাতীয় ডায়াবেটিস সচেতনতা দিবস।
২ মার্চ ==> জাতীয় পতাকা দিবস।
৮ মার্চ ==> বিশ্ব নারী দিবস।
১৭ মার্চ ==> শিশু দিবস।
২১ মার্চ ==> বিশ্ব বৈষম্য দিবস।
২২ মার্চ ==> বিশ্ব পানি দিবস।
২৩ মার্চ ==> বিশ্ব আবহাওয়া দিবস।
২৪ মার্চ ==> বিশ্ব যক্ষা দিবস।
২৬ মার্চ ==> স্বাধীনতা দিবস।
৩১ মার্চ ==> জাতীয় দুর্যোগ প্রস্তুতি দিবস।
২ এপ্রিল ==> জাতীয় প্রতিবন্ধী দিবস।
৭ এপ্রিল ==> বিশ্ব স্বাস্থ্য দিবস।
১৭ এপ্রিল ==> মুজিবনগর দিবস।
২৩ এপ্রিল ==> বিশ্ব গ্রন্থ ও গ্রন্থস্বত্ব দিবস।
২৬ এপ্রিল ==> বিশ্ব মেধা সম্পদ দিবস।
১ মে ==> মহান মে দিবস।
৩ মে ==> বিশ্ব সংবাদপত্র স্বাধীনতা দিবস।
৪ মে ==> আন্তর্জাতিক শিশু দিবস।
১৩ মে ==> বিশ্ব মা দিবস।
১৫ মে ==> বিশ্ব পরিবার দিবস।
১৬ মে ==> ফারাক্কা দিবস।
১৭ মে ==> বিশ্ব টেলিযোগাযোগ দিবস।
২২ মে ==> বিশ্ব জীববৈচিত্র দিবস।
২৫ মে ==> কাজী নজরুল ইসলাম-এর জন্মবার্ষিকী।
২৮ মে ==> নিরাপদ মাতৃত্ব দিবস।
২৯ মে ==> বিশ্ব জাতিসংঘ শান্তি রক্ষা দিবস।
৩১ মে ==> বিশ্ব তামাক মুক্ত দিবস।
৫ জুন ==> বিশ্ব পরিবেশ দিবস।
৭ জুন ==> ছয় দফা দিবস।
১২ জুন ==> বিশ্ব শিশুশ্রম প্রতিরোধ দিবস।
১৩ জুন ==> নারী উত্ত্যক্তকরণ প্রতিরোধ দিবস বা ইভ টীজিং প্রতিরোধ দিবস।
২৩ জুন ==> পলাশী দিবস।
২০ জুন ==> বিশ্ব উদ্বাস্তু দিবস।
২১ জুন ==> বিশ্ব সংগীত দিবস।
১ জুলাই ==> ঢাকা বিশ্ববিদ্যালয় দিবস।
৩ জুলাই ==> জন্ম নিবন্ধন দিবস।
৭ জুলাই ==> বিশ্ব সমবায় দিবস।
১০ জুলাই ==> মুসক দিবস।
১১ জুলাই ==> বিশ্ব জনসংখ্যা দিবস।
১৮ জুলাই ==> ম্যান্ডেলা দিবস।
২৯ জুলাই ==> বিশ্ব বাঘ দিবস।
৬ আগস্ট ==> হিরোসিমা দিবস।
৯ আগস্ট ==> বিশ্ব আদিবাসী দিবস ও নাগাসাকি দিবস।
আগস্ট এর প্রথম রবিবার ==> বিশ্ব বন্ধু দিবস।
১২ আগস্ট ==> বিশ্ব যুব দিবস।
১৫ আগস্ট ==> জাতীয় শোক দিবস।
৮ সেপ্টেম্বর ==> বিশ্ব স্বাক্ষরতা / নিরক্ষরতা দিবস।
১৫ সেপ্টেম্বর==> জাতীয় আয়কর দিবস।
সেপ্টেম্বর এর তৃতীয় মঙ্গলবার ==> বিশ্ব শান্তি দিবস।
১৭ সেপ্টেম্বর==> মহান শিক্ষা দিবস।
৫ অক্টোবর ==> শিক্ষক দিবস।
৯ অক্টোবর ==> বিশ্ব ডাক দিবস।
১৬ অক্টোবর ==> বিশ্ব খাদ্য দিবস।
২২ অক্টোবর==> জাতীয় সড়ক নিরাপদ দিবস।
৩ নভেম্বর==> জেলহত্যা দিবস।
৪ নভেম্বর==> সংবিধান দিবস।
৭ নভেম্বর==> জাতীয় বিপ্লব ও সংহতি দিবস।
১০ নভেম্বর==> নূর হোসেন দিবস বা স্বৈরাচার বিরোধী দিবস ও মালাল দিবস।
২১ নভেম্বর==> সশস্ত্রবাহিনী দিবস।
১ ডিসেম্বর==> মুক্তিযোদ্ধা দিবস ও বিস্ব এইডস দিবস।
৩ ডিসেম্বর ==> বিশ্ব প্রতিবন্ধী দিবস।
৬ ডিসেম্বর==> স্বৈরাচার পতন দিবস* বা সংবিধান সংরক্ষণ দিবস।
৯ ডিসেম্বর==> রোকেয়া দিবস।
১০ ডিসেম্বর ==> বিশ্ব মানবাধিকার দিবস।
১৪ ডিসেম্বর==> শহীদ বুদ্ধিজীবি দিবস।
১৬ ডিসেম্বর==> বিজয় দিবস।
১৮ ডিসেম্বর ==> আন্তর্জাতিক অভিবাসী দিবস।
আন্তর্জাতিক দিবস
বিশ্ব জনসংখ্যা দিবস- ২ জানুয়ারি
বিশ্ব শিশু ক্যান্সার দিবস- ২৫ জানুয়ারি
আন্তর্জাতিক শুল্ক দিবস- ২৬ জানুয়ারি
বিশ্ব জলাভূমি দিবস- ২ ফেব্রুয়ারী
বিশ্ব ক্যান্সার দিবস- ৪ ফেব্রুয়ারী
বিশ্ব ভালোবাসা দিবস- ১৪ ফেব্রুয়ারী
বিশ্ব সামাজিক ন্যায় বিচার দিবস- ২০ ফেব্রুয়ারী
আন্তর্জাতিক মাতৃভাষা দিবস- ২১ ফেব্রুয়ারী
বিশ্ব স্কাউট দিবস- ২২ ফেব্রুয়ারী
আল কুদস দিবস- ২৪ ফেব্রুয়ারী
আন্তর্জাতিক নারী দিবস- ৮ মার্চ
বিশ্ব কিডনি দিবস- ৯ মার্চ
বিশ্ব ক্রেতা দিবস- ১৫ মার্চ
বিশ্ব বন দিবস- ২১ মার্চ
আন্তর্জাতিক বর্ণবৈষম্য দিবস- ২১ মার্চ
বিশ্ব কবিতা দিবস- ২১ মার্চ
বিশ্ব পানি দিবস- ২২ মার্চ
বিশ্ব আবহাওয়া দিবস- ২৩ মার্চ
বিশ্ব যক্ষ্মা দিবস- ২৪ মার্চ
বিশ্ব নাট্য দিবস- ২৭ মার্চ
কমনওয়েলথ দিবস- মার্চ মাসের দ্বিতীয় সোমবার
বিশ্ব স্বাস্থ্য দিবস- ০৭ এপ্রিল
বিশ্ব হিমোফেলিয়া দিবস- ১৭ এপ্রিল
বিশ্ব যুবসেবা দিবস- ২১ এপ্রিল
বিশ্ব ধরিত্রী দিবস- ২২ এপ্রিল
বিশ্ব মেধা সম্পদ দিবস- ২৬ এপ্রিল
বিশ্ব শিশু দিবস- ২৭ এপ্রিল
আন্তর্জাতিক নৃত্য দিবস- ২৯ এপ্রিল
মে দিবস (শ্রমিক দিবস)- ০১ মে
বিশ্ব সংবাদপত্রের স্বাধীনতা দিবস- ০৩ মে
(সফটওয়ার স্বাধীনতা দিবস)
বিশ্ব ন্যায্য বাণিজ্য দিবস- ০৪ মে
বিশ্ব হাঁপানি দিবস- ০৪ মে
বিশ্ব রেডক্রস দিবস- ৮ মে
আন্তর্জাতিক থ্যালাসেনিয়া দিবস- ৮ মে
আন্তর্জাতিক সেবিকা দিবস- ১২ মে
আন্তর্জাতিক পরিবার দিবস- ১৫ মে
বিশ্ব টেলিযোগাযোগ দিবস- ১৭ মে
বিশ্ব উচ্চ রক্তচাপ দিবস- ১৭ মে
বিশ্ব জীববৈচিত্র্য দিবস- ২২ মে
বিশ্ব নিরাপদ মাতৃত্ব দিবস- ২৮ মে
বিশ্ব ধূমপান বর্জন দিবস- ৩১ মে
বিশ্ব মা দিবস- মে মাসের দ্বিতীয় রবিবার
বিশ্ব পরিবেশ দিবস- ০৫ জুন
বিশ্ব শিশুশ্রম প্রতিরোধ দিবস- ১২ জুন
বিশ্ব রক্তদাতা দিবস- ১৪ জুন
বিশ্ব মরুময়তা দিবস- ১৭ জুন
আন্তর্জাতিক উদ্বাস্তু দিবস- ১৯ জুন
বিশ্ব শরণার্থী দিবস- ২০ জুন
আন্তর্জাতিক অলিম্পিক দিবস- ২৩ জুন
আন্তর্জাতিক মাদকবিরোধী দিবস- ২৬ জুন
বিশ্ব বাবা দিবস- জুন মাসের দ্বিতীয় রবিবার
আন্তর্জাতিক সমবায় দিবস- ০১ জুলাই
বিশ্ব জনসংখ্যা দিবস- ১১ জুলাই
বিশ্ব মাতৃদুগ্ধ দিবস- ১ আগষ্ট
হিরোশিমা দিবস- ৬ আগষ্ট
নাগাসাকি দিবস- ৯ আগষ্ট
বিশ্ব আদিবাসী দিবস- ৯ আগষ্ট
আন্তর্জাতিক যুব দিবস- ১২ আগষ্ট
বিশ্ব আলোকচিত্র দিবস- ১৯ আগষ্ট
আন্তর্জাতিক বন্ধুত্ব দিবস- আগষ্ট মাসের প্রথম রবিবার
বিশ্ব স্বাক্ষরতা দিবস- ৮ সেপ্টেম্বর
বিশ্ব আত্মহত্যা প্রতিরোধ দিবস- ১০ সেপ্টেম্বর
বিশ্ব গণতন্ত্র দিবস- ১৫ সেপ্টেম্বর
Collected :