package addressbook;
public class AddressBook
// This class defines an address book, consisting of 10 parts
{
// Class constant
final String PUNCT = ", "; // Punctuation for formatting
// Instance variable
String...
The best way to code programs.
Powered by Blogger.
.
Home > Archives for 2015
Friday, 27 March 2015
Program to do circle operations in JAVA
import java.text.*;
public class Circle
{
public static void main (String[] args)
{
// create decimal format
DecimalFormat DF = new DecimalFormat ("0.00000");
...
Program to generate MARKSHEET in JAVA
import java.util.Scanner;
class Marksheet
{
public static void main(String[] arg)
{
Scanner sc=new Scanner(System.in);
System.out.println("\nWel come to marks sheet");
System.out.print("Enter the name of Student \t:\t");
String...
Metric conversion program in JAVA
import java.util.Scanner;
class conversion
{
static float dollartorupees()
{ Scanner sc=new Scanner(System.in);
System.out.println("enter the dollar");
float...
Calculator program in JAVA using if else statements
import java.util.Scanner;
public class calculator
{
int c;
public void add()
{
Scanner sc =new Scanner(System.in);
System.out.println("enter first no.");
int a=sc.nextInt();
System.out.println("enter second no. ");
int...
Small shopping project in JAVA
import java.util.Scanner;
class Product
{
Scanner sc=new Scanner(System.in);
int ProductID;
String ProductName, ProductType;
float ProductPrice;
Product()
{
System.out.print("Enter the Product ID = ");
ProductID=sc.nextInt();
System.out.print("Enter...
Matrix addition program in JAVA
import java.util.Scanner;
class addm
{
public static void main(String[] arg)
{
int i,j;
int a[][]=new int[3][3];
Scanner sc=new Scanner(System.in);
for(i=0;i<3;i++)
{
...
Program to find diagonal elements in matrix
import java.util.Scanner;
class diagonalm
{
public static void main(String[] arg)
{
int i,j;
int a[][]=new int[3][3];
Scanner sc=new Scanner(System.in);
for(i=0;i<3;i++)
{
...
Download program of LOGIC GATE IN JAVA
AND GATE
package logicgate;
public class and
{
int z1;
public int dooperation(int x1,int y1)
{
int z;
z=x1*y1;
z1=z;
return(z1);
}
}
NOT GATE
package...
Program to find pallindrome in JAVA
class Pallindrome
{
public static void main(String args[])
{
int num=131;
int r,temp,sum=0;
temp=num;
while(num!=0)
{
r=num%10;
num=num/10;
sum=sum*10+r;
}
if(sum==temp)
System.out.println("no. is pallindrome");
else
System.out.println("no....
Program to find electricity bill in JAVA using if and else conditions
class electricity
{
Public static Void main(String args[])
{
int unit=Integer.parseInt(args[1]);
String name=args[0];
float rupees=0.0f;
{
if (unit<100)
rupees=rupees +unit*.40;
else if(unit>100 && unit<300)
rupees=rupees+(unit-100)*.50;
else...
Program to find area of circle and cylinder in JAVA
class Area{
final float PI=3.14f;
float arac,aracy;
int r=2,h=3,l=4;
void areaofcircle()
{
arac=PI*r*r;
System.out.println("area of circle="+arac);
}
void areaofcylinder()
{
aracy=((PI*r*r*h)+(2*PI*r*l));
System.out.println("area...
Swapping two variables with using third variable in JAVA
class swap
{
public static void main(String []args)
{
int a=25;
int b=10;
System.out.println("Intially a="+a+"b="+b);
...
Program to find factorial in JAVA
class factorial{public static void main(String args[]){ int f=1,i; for(i=1;i<=5;i++) f=f*i; System.out.println("factorial="+f);}...
Program to set and print employee details
class Details{
int empid,deptid,salary;
//method to set details
void setEmployeeDetails()
{
empid=10002;
deptid=15;
salary=5000;
}
//method to print details
void printEmployeeDetails()
{
System.out.println(empid);
System.out.println(deptid);
System.out.println(salary);
...
Prime number program in JAVA
Program to find prime number in java
class prime{
public static void main(String []args){
int num=6;
int fac=0;
for(int i=1;i<=6;i++)
{
if(num%i==0)
fac++;
}
if(fac==2)
System.out.println("Is...
Fibonacci program in JAVA
Program to find fibonacci series in JAVA
class fib
{
public static void main(String[] arg)
{
int i,a=0,b=0,c=1;
int n=8;
System.out.println("fibonacci series"+n);
for(i=1;i<=n;i++)
...
Finding five armstrong numbers in JAVA
Program to find Five armstrong Numbers in java
class fivearms
{
public static void main(String args[])
{
int r,temp,count;
for(count=1;count<500;count++)
{
int sum=0;
temp=count;
while(temp!=0)
{
r=temp%10;
temp=temp/10;
sum=sum+(r*r*r);
}
if(sum==count)
System.out.println("no.s...
"Hello World" program in JAVA
Steps to develop a hello world program in java-
class Hello {
//Everything should be written inside this block
public static void main(String args[])
{
//to print on the console
System.out.println("hellow...
Thursday, 22 January 2015
change text color of c/c++ console applications
Changing background or text of console in c++ is not a very major task. One can do it easily by doing some really good efforts . This tutorial is all about changing the colors in c++ which helps to look application similar...
How to validate a date in c++ ?
Validation of date in c++ involves three steps -
1) Declare the function inside the body of a class.
2) Give definition to it outside the class using scope resolution.
3) Call it using do while loop by passing string...
How to Validate String in c++ ?
Validation of string in c++ involves three steps -1) Declare the function inside the body of a class.2) Give definition to it outside the class using scope resolution.3) Call it using do while loop by passing string in...
How to Validate a Number/Integer in c++ ?
Validation of integer in c++ involves three steps -1) Declare the function inside the body of a class.2) Give definition to it outside the class using scope resolution.3) Call it using do while loop by passing string type...
Subscribe to:
Posts (Atom)
Programs
-
▼
2015
(23)
-
▼
March
(19)
- Address Book program in JAVA
- Program to do circle operations in JAVA
- Program to generate MARKSHEET in JAVA
- Metric conversion program in JAVA
- Calculator program in JAVA using if else statements
- Small shopping project in JAVA
- Matrix addition program in JAVA
- Program to find diagonal elements in matrix
- Download program of LOGIC GATE IN JAVA
- Program to find pallindrome in JAVA
- Program to find electricity bill in JAVA using if ...
- Program to find area of circle and cylinder in JAVA
- Swapping two variables with using third variable i...
- Program to find factorial in JAVA
- Program to set and print employee details
- Prime number program in JAVA
- Fibonacci program in JAVA
- Finding five armstrong numbers in JAVA
- "Hello World" program in JAVA
-
▼
March
(19)
..
...
Premium Sponsor
Find us on Google Plus
Labels
Popular Posts
-
import java.util.Scanner; class Marksheet { public static void main(String[] arg) { Scanner sc=new Scanner(System.in); System.out.pri...
-
Steps to develop a hello world program in java- class Hello { //Everything should be written inside this block public static voi...
-
Program to find fibonacci series in JAVA class fib { public static void main(String[] arg) { int i,a=0,b=0,c=1; int n=8; ...
-
import java.util.Scanner; class conversion { static float dollartorupees() { Scanner sc=new Scanner(System.in); System.out...
-
Validation of date in c++ involves three steps - 1) Declare the function inside the body of a class. 2) Give definition to it outside t...
-
import java.util.Scanner; class Product { Scanner sc=new Scanner(System.in); int ProductID; String ProductName, ProductType; float Pr...
-
package addressbook; public class AddressBook // This class defines an address book, consisting of 10 parts { // Class constant ...
-
import java.text.*; public class Circle { public static void main (String[] args) { // create decimal format Decim...
-
import java.util.Scanner; class diagonalm { public static void main(String[] arg) { int i,j; int a[][]=new int[3][3]; Scanner ...
-
Changing background or text of console in c++ is not a very major task. One can do it easily by doing some really good efforts . This tutor...