Wednesday, September 12, 2012

Power + SnS -> slides + .m Files

Power + SnS ==> slides + .m Files
Download Here.....

Saturday, May 5, 2012

Ideas for Java Project


Binary to Decimal and Back Converter – Converter to convert a decimal number to binary or a binary number to its decimal equivalent.

Calculator – A simple calculator to do basic operators. Make it a scientific calculator for added complexity.

Unit Converter (temp, currency, volume, mass and more) – Converts various units between one another. The user enters the type of unit being entered, the type of unit they want to convert to and then the value. The program will then make the conversion.

Alarm Clock – A simple clock where it plays a sound after X number of minutes/seconds or at a particular time.

Chat Application (IRC or MSN Style) – Create a chat application that can carry on simple chat rooms like on Internet Relay Chat or a more direct chatting style like MSN. For added complexity, create your own protocol to facilitate this chatting.

Create Progress Bar of Download – Create a progress bar for applications that can keep track of a download in progress. The progress bar will be on a separate thread and will communicate with the main thread using delegates.

Chat Application (remoting style) – Create a chat application which allows you to connect directly to another computer by their IP through the use of remoting and allow your “server” application handle multiple incoming connections.

Stream Video from Online – Try to create your own online streaming video player.

Traffic Light Application – See if you can make your own street light application and then put it into an intersection scenario. Don’t let any cars run the lights and crash into one another!

Screen Saver – Make a screensaver program that will run while your computer sits idle. To make a simple one use some standard pictures and then for added complexity try a 3D object that spins around the screen and bounces off the sides.

Hangman – Randomly select a word from a file, have the user guess characters in the word. For each character they guess that is not in the word, have it draw another part of a man hanging in a noose. If the picture is completed before they guess all the characters, they lose.

Crossword Puzzle – Create a crossword puzzle which links words together on common letters. Provide a list of clues for each word and let the user enter fill in the words until the entire crossword is filled in.

Frogger – Get your frog across the river and lanes of traffic by either jumping on logs and lily pads rushing by at different speeds or avoid the automobiles which are also moving at various speeds. Based on the old arcade game.

Pac Man – Another arcade classic, move Pac man around a maze gobbling up pellets and trying to avoid a group of ghosts. Power pellets allow Pac man to eat the ghosts for a limited time.

Find Way Out of Maze – Develop an algorithm that allows a mouse to navigate through any maze given enough time.

Pin Ball – I think we all know how pin ball works. Make a game where the user controls to mini paddles and keeps a ball in play, bouncing off various items and navigating through the course for various points. For added complexity, create a high score list.

Tic Tac Toe with Friend Online – A simple game of tic tac toe. For added complexity allow the application to be played over the internet where another player can against you.

Game of Memory – Make a game where you have 8, 16, 32 or 64 cards which are to be matched in pairs. The user enters which two cards to turn over to see if they are a pair. Show the user the cards they turned over, if they match remove them from the game. If they do not match, flip them back over. For added complexity, impose a time limit or a turn limit.

Snake Game – Create a board where you start out with a small snake. The goal is to eat as much food that appears on the board as possible without it running into its own body. Each time it eats food the snake grows longer. How long can you make your snake?


Automobile maintenance tracker program
Home budget program
File upload program (using HTTP)
FTP program
Text editor (more advanced then Notepad of course)
Tabbed web browser with favorites, bookmarks, etc
Image editor
Web cam image capture program
Calculator
Task manager clone
Mortgage calculator
Inventory management program
Payroll program
Billing/Invoicing application
Control Library(Buttons, ProgressBars, Grid, etc.)
Math Program(Calculus, Trig, Algebra 2, Geometry, Algebra, etc.) includes Graphing.
Email Program (POP, IMAP or HTTP)
WebBrowser (Include items such as favorites, bookmarks, history list, etc)

Friday, April 27, 2012

Abstract Classes and Methods

Example of Abstract class in java :
Abstract Classes : Shape , Two Dim , Three Dim
Concrete Classes : Circle , square , triangle , sphere
Download file

Inheritance

Example of Inheritance in java.
Super Class --> Person
Subclass --> Student , Employee
Download File from this link.

Wednesday, April 11, 2012

Matrix Operations in java


MATRIX Class:



package matrix;
import java.util.Scanner;

public class Matrix {
        private int ROWS;
        private int COLOUM;
        private int totalMatrix;
        public double mat[][][];
        Scanner input = new Scanner(System.in);
        public Matrix(int rows,int coloum,int matNo){
                ROWS = rows;
                COLOUM = coloum;
                totalMatrix = matNo;
                mat = new double[totalMatrix+1][ROWS][COLOUM];
        }
        public void add(int oprnd1,int oprnd2){
                for(int i = 0;i<ROWS;i++)
                        for(int j=0 ; j<COLOUM;j++)
                                mat[totalMatrix][i][j] = mat[oprnd1-1][i][j] + mat[oprnd2-1][i][j];
        }
        public void subtract(int oprnd1,int oprnd2){
                for(int i = 0;i<ROWS;i++)
                        for(int j=0 ; j<COLOUM;j++)
                                mat[totalMatrix][i][j] = mat[oprnd1-1][i][j] - mat[oprnd2-1][i][j];
        }
        public void multiplication(int oprnd1,int oprnd2){
                if(ROWS == COLOUM)
                for(int i = 0;i<ROWS;i++)
                        for(int j=0 ; j<COLOUM;j++)
                                for(int k = 0;k<ROWS;k++ )
                                        mat[totalMatrix][i][j] += (mat[oprnd1-1][i][k]*mat[oprnd2-1][k][j]);
        }
        public void transpose(int matNo){
                double matRes[][] = new double[ROWS][COLOUM];
                for(int j = 0;j<ROWS;j++)
                        for(int i=0 ; i<COLOUM ; i++)
                                matRes[i][j]=mat[matNo-1][i][j];
                for(int j = 0;j<ROWS;j++)
                        for(int i=0 ; i<COLOUM ; i++)
                                mat[matNo-1][i][j]=matRes[j][i];
        }
        public void setMat(int matNo){
                for(int i = 0;i<ROWS;i++)
                        for(int j=0 ; j<COLOUM;j++)
                        {
                                System.out.printf("Enter number for Matrix %d [%d][%d] : ",matNo,i+1,j+1);
                                mat[matNo-1][i][j] = input.nextDouble();
                        }
        }
        public void display(int matNo){
                for(int i = 0;i<ROWS;i++)
                {
                        for(int j=0 ; j<COLOUM;j++)
                                System.out.print(mat[matNo-1][i][j]+"\t");
                        System.out.println();
                }
        }
}


MATRIX Test Class:

package matrix;
import java.util.Scanner;

public class MatrixTest {

        public static void main(String[] args) {
                Scanner input = new Scanner(System.in);
                System.out.print("Enter [Rows][Coloum] : ");
                int rows = input.nextInt();
                int coloum = input.nextInt();
                System.out.print("Enter count of MATRICES to create : ");
                int matCount = input.nextInt();
                Matrix matrix = new Matrix(rows,coloum,matCount);
                while(true)
                {
                        System.out.print("1. Setting Matrices\n"
                                +"2. Operations\n"
                                +"3. Display\n"
                                +"4. Exit\n"
                                +"Enter your Choice : ");
                        switch (input.nextInt())
                        {
                                case 1:
                                        System.out.print("Enter Matrix number to set : ");
                                        int matNo = input.nextInt();
                                        matrix.setMat(matNo);
                                        break;
                                case 2:
                                        System.out.print("1. Addition\n"
                                                +"2. Subtraction\n"
                                                +"3. Multiplication\n"
                                                +"4. Transpose\n"
                                                +"Enter operation : ");
                                                int choice = input.nextInt();
                                               
                                                System.out.print("Enter matrices"
                                                        + " for operation : ");
                                                int mat1 = input.nextInt();
                                                int mat2 = input.nextInt();
                                        switch (choice)
                                        {
                                                case 1:
                                                        matrix.add(mat1, mat2);
                                                        matrix.display(matCount+1);
                                                        break;
                                                case 2:
                                                        matrix.subtract(mat1, mat2);
                                                        matrix.display(matCount+1);
                                                        break;
                                                case 3:
                                                        matrix.multiplication(mat1, mat2);
                                                        matrix.display(matCount+1);
                                                        break;
                                                case 4:
                                                        matrix.transpose(mat1);
                                                        matrix.display(mat1);
                                                        break;
                                        }  
                                        break;
                                case 3:
                                        System.out.print("Enter Matrix number to display : ");
                                        matrix.display(input.nextInt());
                                        break;
                                case 4:
                                        System.exit(0);
                        }
                }
        }
}


follow for appreciation.

Tuesday, April 3, 2012

OOP SALES Lab Task 3 - april - 12




< Sales.java >


public class Sales {
        public int PERSON = 4;
        public int ITEM = 6;
        private int matrix[][] = new int[PERSON+1][ITEM+1];
        public Sales(){
                for(int person = 0;person<this.PERSON;person++)
                matrix[person][0]= person+1;
               
        }/*
        public void personsale(){
                for(int person =0;person<this.PERSON;person++)
                        for(int item = 1;item<this.ITEM;item++)
                                matrix[person][item] = 10;
        }*/
        public void PersonSale(int person ,int item ,int ammount){
                matrix[person][item] = ammount;
        }
        public void salesPersonTotal(){
                for(int person =0 ; person<4 ; person++)

                        for(int item = 1; item < 6 ; item++)
                        {
                                matrix[person][6] = matrix[person][6]+matrix[person][item];
                        }
        }
        public void salesItemTotal(){
                for(int i=1;i<=this.ITEM;i++)
                for(int j=0;j<=this.PERSON-1;j++)
                matrix[4][i]=matrix[4][i]+matrix[j][i];
        }
       
        public void display(){
               
                this.salesPersonTotal();
                this.salesItemTotal();
                System.out.println("PERSON\tI1\tI2\tI3\tI4\tI5\ttotal");
                for(int person = 0; person<5 ; person++ )
                {
                        for(int row = 0;row<7;row++){
                                System.out.printf("%d\t",matrix[person][row]);
                        }
                        System.out.println();
                }
        }
}



< SalesTest.java >


import java.util.Scanner;

public class SalesTest {

        public static void main(String[] args) {
                Scanner input = new Scanner(System.in);
                Sales sales = new Sales();
                while(true)
                {
                        System.out.println("Enter person ID (1-4):");
                        int person = input.nextInt();
                        if(person<=0||person>sales.PERSON)
                                break;
                        System.out.println("Enter Item ID (1-5):");
                        int item = input.nextInt();
                        if(item<=0||item>sales.ITEM)
                                break;
                        System.out.println("Enter item ammount :");
                        int ammount = input.nextInt();
                       
                        sales.PersonSale(person-1, item, ammount);
                }
                sales.display();
        }
}






< OUTPUT >


PRSN I1 I2 I3 I4 I5 total
1 12 15 0 0 0 27
2 0 15 0 0 0 15
3 0 0 0 0 0 0
4 0 0 0 0 0 0
0 12 30 0 0 0 42




Sunday, February 12, 2012

Electronics-I

M Nafees

Electronic Devices and Circuit Theory 7th Edition
Boylestad
HERE

Digital Logic Design

Digital Design 
Morris Mano
3rd Ed

HERE


Ahmad Saeed
Link
Enrollment Key:
"EEE241-DLD-bte-15B"


Proteus Pro 7.7 HERE

Logic Gates....

Differential Equations

Differential Equations with Boundary-Value Problems 

7th Ed

Dennis G. Zill, Michael R. Cullen

HERE

Object Oriented Programming

Object Oriented Programming
Java Development Kit 7.2  HERE
JCreater Pro  HERE
Eclipse  x86  x64
Instructor's  link
JAVA,How to program 8th Ed  HERE
Thinking in JAVA 4th Ed  HERE




HELLO WORLD

public class HelloWorld 
 public static void main(String[] args
 
 System.out.println("Hello World!")
 
}


  CALCULATOR
NOTE:-


 "DO NOT Email as it is to sir sohaib.plzzzz....."
 "It is just for helpingmy fellows."


/**
* @(#)Calculator.java
*
*
* @author Awais Ahmad Alvi BTE-SP11-012-B
* @version 1.00 2012/2/28
*/


public class Calculator {

private double op1,op2,result;
public Calculator() {
}
public void setOp1(double op_1){
op1 = op_1;
}
public void setOp2(double op_2){
op2 = op_2;
}
public double getOp1(){
return op1;
}
public double getOp2(){
return op2;
}
public double getResult(){
return result;
}
public void add(){
result = getOp1() + getOp2();
}
public void sub(){
result = getOp1() - getOp2();
}
public void multi(){
result = getOp1() * getOp2();
}
public void div(){
if(getOp2() == 0)
result = 0;
else
result = getOp1()/getOp2();
}
public void pow(){
int counter;
result = 1;
for(counter = 1;counter<=getOp2();counter++)
result = getOp1()*result;
}
}





/**
* @(#)CalculatorTest.java
*
*
* @author Awais Ahmad Alvi BTE-SP11-012-B
* @version 1.00 2012/2/28
*/

import java.util.Scanner;
public class CalculatorTest {

public static void main(String a[]){
Scanner sc = new Scanner(System.in);
Calculator cal = new Calculator();
double op1,op2,result;
int operation;
System.out.println("Enter operation\n"+"1. ADDITION\n2. SUBTRATION\n"
+"3. MULTIPLICATION"+"\n4. DIVISION\n"+"5. POWER");
operation = sc.nextInt();

System.out.println("Enter First no:");
op1 = sc.nextInt();
cal.setOp1(op1);
System.out.println("Enter Second no:");
op2 = sc.nextInt();
cal.setOp2(op2);

if(operation == 1)
cal.add();
else if(operation == 2)
cal.sub();
else if(operation == 3)
cal.multi();
else if(operation == 4)
cal.div();
else if(operation == 5)
cal.pow();
else
System.out.println("Invalid Entry");
System.out.println(cal.getResult());
}


}