Skip to main content

Posts

Showing posts from November, 2013

simple basic object oriented java code for employee salary calculation

import java.io.*; import java.util.Scanner; public class Employees {     Scanner scan=new Scanner(System.in);     String Fname;   int EmpID;  int DOB; double Allowance;   double Salary;     public void getDetails(){   System.out.println("Enter the first name");   Fname=scan.next();   System.out.println("Enter the ID number");   EmpID=scan.nextInt();   System.out.println("Enter the date of birth");   DOB=scan.nextInt();   System.out.println("Enter the salary");   Salary=scan.nextDouble();   Allowance=0.6*Salary;     }    public void printReport(){    System.out.println(Fname+"\t"+EmpID+"\t"+calGross()+"\t"+calPayee()+"\t"+calNetIncome());    }    public double calGross(){        return Salary + Allowance;    }    public double calPayee(){     ...

use cases,Activity diagrams

use cases Advantages: Nice way to wak through use cases to test your design. Nice to use when talking and developing in a team. Once you have the design down the coding can be stubbed out so that testing and developing can be done by more than one person. Easy to write up simple ones on a white-board. Disadvantage: they are usually not documents that are kept up to date so they don't work well as long-term documentation Activity diagrams' disadvantages: UML modeling language include that these diagrams have the potential to become overly complex because their user-friendly nature may lend itself to an all-inclusive description. In other words, since it is so simple to display the information related to the project, why not include all of it? When an analyst has a large project, creating a single, overly complex diagram can be a temptation. However, as one author notes, "if you are using activity diagrams to define the structure of a work flow, you should...

sequence diagrams

A sequence diagram shows, as parallel vertical lines ( lifelines ), different processes or objects that live simultaneously, and, as horizontal arrows, the messages exchanged between them, in the order in which they occur. This allows the specification of simple runtime scenarios in a graphical manner. Sequence diagrams are typically used to model: Usage scenarios .  A usage scenario is a description of a potential way your system is used. The logic of a usage scenario may be part of a use case, perhaps an alternate course. It may also be one entire pass through a use case, such as the logic described by the basic course of action or a portion of the basic course of action, plus one or more alternate scenarios. The logic of a usage ...

MYSQL DATABASE ENVIRONMENT BASICS

When you open the client, you will be prompted to enter the password for the root account. This is the password that was previously configured. Type the password and hit Enter. You should see that you have entered the MySQL environment: To create a database, type the following command: CREATE DATABASE uestudio_sample; where "uestudio_sample" is the name of the database. Note: be sure to include the semi-colon at the end of the command. If the command is successful you will see something similar to: Query OK, 1 row affected (0.00 sec) You may verify that the databases have been created by using the " Show Databases " command. If you type, "Show Databases;" and hit enter, you should see something similar to: Create a Table For the purposes of this Power Tip, we will create a table called "names" that includes the following fields: key, first, last. You may create this table using the following steps: Type: ...

Create a Local PHP MySQL Development Environment

Step 1. Download the installation files You will need to download and install the windows version of the installers for each of the below componments: Apache Apache is the HTTP (Web) server software. http://httpd.apache.org/download.cgi PHP PHP is the general-purpose scripting language, especially suited for Web development, that we will be using. http://www.php.net/downloads.php MySQL Server http://dev.mysql.com/downloads/mysql/5.0.html#win32 Step 2: Install Apache Run the Apache install file. You will need to follow the prompts and respond accordingly. When you reach the window that asks for server information, you may enter the following: Network Domain: localhost Server Name: localhost Administrator Email: (any email address) Also ensure the "for all Users, on Port 80, as a Service -- Recommended" is checked.  Continue clicking " Next " until the installation is complete. If Apache has been installed correctly, and the s...

Simple java class code that implements Serializable,ServerSocket, InputStream,ObjectInputStream, Socket

import java.net.*; import java.io.*; class ShopItem implements Serializable{     int shopid;     String name;     float cost;     public ShopItem(int id, String s, float c){         this.shopid=id;         this.name=s;         this.cost=c;     } } public class ObjectServer {     public static void main(String args[]){         int port=2002;         try{            ServerSocket ss=new ServerSocket(port);            Socket s=ss.accept();            InputStream is=s.getInputStream();            ObjectInputStream ois=new ObjectInputStream(is);            ShopItem to=(ShopItem)ois.readObject();            if(to!=null){   ...