.

Friday, 27 March 2015

Address Book program in JAVA

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...
Read more ...

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");    ...
Read more ...

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...
Read more ...

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...
Read more ...

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...
Read more ...

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...
Read more ...

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++)  {  ...
Read more ...

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++)  {  ...
Read more ...

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...
Read more ...

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....
Read more ...

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...
Read more ...

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...
Read more ...

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);    ...
Read more ...

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);}...
Read more ...

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);  ...
Read more ...

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...
Read more ...

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++)  ...
Read more ...

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...
Read more ...

"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...
Read more ...

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...
Read more ...

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...
Read more ...

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...
Read more ...

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...
Read more ...
Pages (4)1234 Next