Monday, October 20, 2014

Print Stylish Asterisk In Java By increment operator

Program:

package prem6;

public class koresi6 {
public static void main(String[]args){
for(int i=1;i<=5;i++){
for(int j=1;j<=i;j++){
System.out.print("*");
}
System.out.println("");
}
}
}
Increment operator:   i++ and j++

Output:

*
**
***
****
*****

Screenshots

Program




Output



Sunday, October 19, 2014

Using Array In Java

Program:

package prem5;

public class koresi5 {
public static void main(String[]args){

int munim[]={12,54,95,68,87,32,45,15};

System.out.println("the 4th number element is " +munim[5]);
}
}

Output:

the 4th number element is 32

Screenshots

Program


Output


Araray In Java

Program:

package prem5;

public class koresi5 {
public static void main(String[]args){
int munim[]=new int[20];

munim[0]=654;
munim[1]=951;
munim[9]=357;

System.out.println(munim[9]);
}
}


Output:

357



Program


Output


Friday, October 17, 2014

Random Number generator In Java

Program:

package prem4;

import java.util.Random;

public class koresi4 {
public static void main(String[]args){
Random trace=new Random ();
int counter;
int number;
for(counter=0;counter<10;counter++){
number=trace.nextInt(8);
System.out.println(number+"");
}
}
}

Output:

2
4
2
3
7
6
3
1
0
3


Screenshots

Program


Output


Mathematical Methods In Java

Program:

package prem3;

public class koresi3 {
public static void main(String[] args){
System.out.println(Math.abs(-3.8)); //absolute value will be the output
System.out.println(Math.pow(3.3, 2));//here 3.3^2=10.88999999999 
System.out.println(Math.max(294, 654));//here the maximum value will be the output
System.out.println(Math.min(856, 121));//here the minimum value is 121
System.out.println(Math.ceil(9.8));//here 9.8 will be 10
System.out.println(Math.ceil(13.4));//here 13.4 will be 14
System.out.println(Math.floor(45.6));//here 45.6 will be 45
System.out.println(Math.sqrt(225));//sqrt means sqare route so output 15
}
}


Output:

3.8
10.889999999999999
654
121
10.0
14.0
45.0
15.0

Screenshots

Program


Output


Thursday, October 16, 2014

Software: Find Interest Using Formula In Java

Software: Find Interest Using Formula In Java: Program: //formula:A=p*(1+r)^n package perm; public class koresi { public static void main(String[]args){ double real=1000; d...

Wednesday, October 15, 2014

Using Do While Loop In Java

Program:

package prem2;

public class koresi2 {
public static void main(String[]args){
int count=10;
do{
System.out.println(count);
count++;
}while(count<=20);
}

}

Output:

10
11
12
13
14
15
16
17
18
19
20
Program


Output


Find Interest Using Formula In Java

Program:

//formula:A=p*(1+r)^n

package perm;

public class koresi {
public static void main(String[]args){
double real=1000;
double rate=0.01;
double result;
int day;
for(day=1;day<=20;day++){
result=real*Math.pow(1+rate, day);
System.out.println(day+"  "+result);
}
}
}

Output:

1  1010.0
2  1020.1
3  1030.3010000000002
4  1040.60401
5  1051.0100501000002
6  1061.520150601
7  1072.13535210701
8  1082.8567056280801
9  1093.6852726843608
10  1104.6221254112045
11  1115.6683466653164
12  1126.8250301319697
13  1138.0932804332895
14  1149.4742132376225
15  1160.9689553699986
16  1172.5786449236987
17  1184.3044313729356
18  1196.147475686665
19  1208.1089504435315
20  1220.190039947967


Program


Output


Friday, September 26, 2014

For Loops In Java Programming

Program:

package serial;

public class tab{
public static void main(String[]args){
int count;
for(count=1;count<=10;count++){
System.out.println(count);
}

}

}

Output:

1
2
3
4
5
6
7
8
9
10

Screenshots

Program



Output


Using Multiple Class In Java

Program:

package munim2;
import java.util.Scanner;
public class rab {
public static void main(String[]args){
Scanner mon=new Scanner(System.in);
jab jabobject=new jab ();

System.out.println("Enter your real name: ");
String name=mon.nextLine();

jabobject.dress(name);
}

}

You must have to take another class to the same source file of the same package.


package munim2;

public class jab {
public static void dress(String name){
System.out.println("Hey "+name);
}

}

Follow the screenshots:

Screenshots

Set Class


Program






Output



Wednesday, September 24, 2014

Simple Hello World Program In PHP

Program:

<?php
     echo 'hello world';

?>

Output In the browser:    hello world


Screenshots

Program


Output



Monday, September 22, 2014

Find Average Using While Loop In Java

Program:


import java.util.Scanner;
public class readerr {
public static void main(String[]args){
Scanner mon=new Scanner(System.in);

double total=0;
double one;
double count = 0;
double average;

while(count<10){
one=mon.nextDouble();
total=total+one;
count++;
}
average=total/10;
System.out.println("the average of the numbers is "+total);

}



Screenshots

Program


Output





where is the wrong keyword written.........find out

Find Average by Scanning In Java

Program:

package munim;
import java.util.Scanner;
public class reader {
public static void main(String[]args){
double a,b,c,average;
Scanner mon=new Scanner(System.in);
a=mon.nextDouble();
b=mon.nextDouble();
c=mon.nextDouble();
average=(a+b+c)/3;
System.out.println("the average is "+average);

}
}

Screenshots

Progam


Output


Conditional Operators In Java

Program:

package munim2;

public class dron {
public static void main(String[] args){

int size;
size=40;
System.out.println(size>30 ? "your size is big" : "your size is small");
}

}

Screenshots

Program


Output



else if Statement In Java Programming

Program:

package munim;
import java.util.Scanner;
public class real {
public static void main(String[] args){

Scanner mon=new Scanner(System.in);
double size;
size=mon.nextDouble();

if(size>40)
System.out.println("there are not dress in your size");
else{
if(size<10)
System.out.println("the dress start from 10 size");
else
System.out.println("there is a dress for you");


}
}
}

Screenshots

program


Output


Thursday, September 4, 2014

Javascript Concept

Javascript:

Javascript is a script which is used in a webpage for dynamic view.It is a scripting language.

At the beginning of the javascript you have to follow these steps.

1.At first you have to download a code editor like notepad++.
2.You must have to know HTML and CSS.
3.Then open notepad++ and write these code.

First code:

<html>
<head>
<title>creativity</title>
</head>
<body>
<script type="text/javascript">
document.write("please touch it");
</script>
</body>
</html>

4.Next you have to save the file anywhere and the file type must be .js and .html extension.And must put the both file in the same folder.
5.Run the HTML file on your browser and get the output below.

Follow the screenshots.

Output on the browser: please touch it.

Screenshots

One


Two


Three

\

Four


Output after run the html file on browser



Sunday, August 24, 2014

Concept of variables in PHP

Program:

<?php
echo 'ami akhon php shikhtesi:i\'m now learning php';

$deal = 'php';

$vat = 'learning';

echo 'ami akhon '.$deal.' shikhtesi:i\'m now '.$vat.' '.$deal.'';
?>

Screenshots


Output


Print a simple line in PHP

Program:

<?php
echo 'ami akhon php shikhtesi:i\'m now learning php ';
?>

Screenshots


Output





Saturday, August 23, 2014

Linking PHP to server by XAMPP

Linking PHP:

1.After downloading XAMPP,you have to install it to your C drive.
2.When install it successfully,then you have to find the C:/>xampp>htdocs .
3.All PHP file will be saved on the htdocs folder.

Now follow the screenshots below:

Screenshots

Step 1:installing Xampp in c drive



Step 2:Saving file directory


Step 3:Saving my php file


Open the program editor like notepad++.Then create a new file and save it the name as your wish on the directory.The file must be a .php(dot php) file.I have saved it as panaroma.php file.

Follow the screenshots:



Screenshots





So,now after saving the file as panaroma.php,go to the browser and write localhost.

But before that you have to remember the XAMPP server was run and start or not.

on your browser you can see:

Screenshots



Next after writing localhost/panaroma.php or which you saved that file to C:/>xampp>htdocs>your saving file on your browser.

Screenshot


This will appear.Because I have saved that file by writing this program on notepad++ as the name of panaroma.php.

Screenshot




Friday, August 22, 2014