Dec 16, 2014

A for Loop in Java example

public class ForElevator {

 public boolean doorOpen=false;
 public int currentFloor = 1;
 public int weight = 0;

 public final int CAPACITY = 1000;
 public final int TOP_FLOOR = 5;
 public final int BOTTOM_FLOOR = 1;

 public void openDoor() {
 System.out.println(“Opening door.”);
 doorOpen = true;
 System.out.println(“Door is open.”);
 }

 public void closeDoor() {
 System.out.println(“Closing door.”);
 doorOpen = false;
 System.out.println(“Door is closed.”);
 }

 public void goUp() {
 System.out.println(“Going up one floor.”);
 currentFloor++;
 System.out.println(“Floor: “ + currentFloor);
 }

 public void goDown() {
 System.out.println(“Going down one floor.”);
 currentFloor--;
 System.out.println(“Floor: “ + currentFloor);
 }

 public void setFloor() {

 // Normally you would pass the desiredFloor as an argument to the
 // setFloor method. However, because you have not learned how to
 // do this yet, desiredFloor is set to a specific number (5)
 // below.

 int desiredFloor = 5;

 if (currentFloor > desiredFloor) {
 for (int down = currentFloor; down != desiredFloor; --down) {
 goDown();
 }
 }

 else {
 for (int up = currentFloor; up != desiredFloor; ++up) {
 goUp();
 }
 }
 }

 public int getFloor() {
 return currentFloor;
 }

 public boolean checkDoorStatus() {
 return doorOpen;
 }
 }

Dec 15, 2014

Nested while Loops in Java example

 public class WhileElevator {

public boolean doorOpen=false;
 public int currentFloor = 1;
 public int weight = 0;

 public final int CAPACITY = 1000;
 public final int TOP_FLOOR = 5;
 public final int BOTTOM_FLOOR = 1;

 public void openDoor() {
 System.out.println(“Opening door.”);
 doorOpen = true;
 System.out.println(“Door is open.”);
 }

 public void closeDoor() {
 System.out.println(“Closing door.”);
 doorOpen = false;
 System.out.println(“Door is closed.”);
 }

 public void goUp() {
 System.out.println(“Going up one floor.”);
 currentFloor++;
 System.out.println(“Floor: “ + currentFloor);
 }

 public void goDown() {
 System.out.println(“Going down one floor.”);
 currentFloor--;
 System.out.println(“Floor: “ + currentFloor);
 }

 public void setFloor() {

 // Normally you would pass the desiredFloor as an argument to the
 // setFloor method. However, because you have not learned how to
 // do this yet, desiredFloor is set to a specific number (5)
 // below.

 int desiredFloor = 5;

 while (currentFloor != desiredFloor)
 if (currentFloor < desiredFloor) {
 goUp();
 }
 else {
 goDown();
 }
 }

 public int getFloor() {
 return currentFloor;
 }

 public boolean checkDoorStatus() {
 return doorOpen;
 }
 }

Dec 13, 2014

Creating while Loops in Java example

public class WhileElevator {

 public boolean doorOpen=false;
public int currentFloor = 1;
 public int weight = 0;

 public final int CAPACITY = 1000;
 public final int TOP_FLOOR = 5;
 public final int BOTTOM_FLOOR = 1;

 public void openDoor() {
 System.out.println(“Opening door.”);
 doorOpen = true;
 System.out.println(“Door is open.”);
 }

 public void closeDoor() {
 System.out.println(“Closing door.”);
 doorOpen = false;
 System.out.println(“Door is closed.”);
 }

public void goUp() {
 System.out.println(“Going up one floor.”);
 currentFloor++;
 System.out.println(“Floor: “ + currentFloor);
 }

 public void goDown() {
 System.out.println(“Going down one floor.”);
 currentFloor--;
System.out.println(“Floor: “ + currentFloor);
 }

 public void setFloor() {

 // Normally you would pass the desiredFloor as an argument to the
 // setFloor method. However, because you have not learned how to
 // do this yet, desiredFloor is set to a specific number (5)
 // below.

 int desiredFloor = 5;

 while (currentFloor != desiredFloor)
 if (currentFloor < desiredFloor) {
 goUp();
 }
 else {
 goDown();
 }
 }

 public int getFloor() {
 return currentFloor;
 }

 public boolean checkDoorStatus() {
 return doorOpen;
 }
 }

Dec 12, 2014

Nested if Statements in Java example

public class NestedIfElevator {

public boolean doorOpen=false; // Doors are closed by default
 public int currentFloor = 1; // All elevators start on first floor
 public final int MAX_FLOORS = 10;
 public final int MIN_FLOORS = 1;

 public void openDoor() {
 System.out.println(“Opening door.”);
 doorOpen = true;
 System.out.println(“Door is open.”);
 }

 public void closeDoor() {
 System.out.println(“Closing door.”);
 doorOpen = false;
 System.out.println(“Door is closed.”);
 }

 public void goUp() {
 System.out.println(“Going up one floor.”);
 currentFloor++;
 System.out.println(“Floor: “ + currentFloor);
 }

 public void goDown() {

 if (currentFloor == MIN_FLOORS) {
 System.out.println(“Cannot Go down”);
 }

 if (currentFloor > MIN_FLOORS) {

 if (!doorOpen) {

 System.out.println(“Going down one floor.”);
 currentFloor--;
 System.out.println(“Floor: “ + currentFloor);
 }
 }
 }

 public int getFloor() {
 return currentFloor;
 }

 public boolean checkDoorStatus() {
 return doorOpen;
 }
 }

Dec 11, 2014

Using If in Java an example

public class IfElevator
{

 public boolean doorOpen=false; // Doors are closed by default
public int currentFloor = 1; // All elevators start on first floor
public final int MAX_FLOORS = 10;
 public final int MIN_FLOORS = 1;

 public void openDoor()
{
 System.out.println(“Opening door.”);
 doorOpen = true;
 System.out.println(“Door is open.”);
 }

 public void closeDoor()
{
 System.out.println(“Closing door.”);
 doorOpen = false;
 System.out.println(“Door is closed.”);
}

 public void goUp()
{
 System.out.println(“Going up one floor.”);
currentFloor++;
System.out.println(“Floor: “ + currentFloor);
}

public void goDown()
{

if (currentFloor == MIN_FLOORS)
{
 System.out.println(“Cannot Go down”);
}

 if (currentFloor > MIN_FLOORS)
{
 System.out.println(“Going down one floor.”);
 currentFloor--;
 System.out.println(“Floor: “ + currentFloor);
}
}

 public int getFloor()
{
 return currentFloor;
}
 public boolean checkDoorStatus()
{
return doorOpen;
 }
}

Dec 10, 2014

What are Uses for Variables ?

• Holding unique data for an object instance
• Assigning the value of one variable to another
• Representing values within a mathematical expression
• Printing the values to the screen
• Holding references to other objects

Naming a Variable

• Rules:
• Variable identifiers must start with either an
uppercase or lowercase letter, an underscore (_), or a
dollar sign ($).
• Variable identifiers cannot contain punctuation,
spaces, or dashes.

• Guidelines:
• Begin each variable with a lowercase letter;
subsequent words should be capitalized, such as
myVariable.
• Chose names that are mnemonic and that indicate to
the casual observer the intent of the variable.

Dec 7, 2014

What is Big Data ?

Many people believe Big Data is simply a large amount of data, but it is defined by more than just size.
Gartner Definition of Big Data is :" Big Data are high-volume, high-velocity, and/or high-variety
information assets that require new forms of processing to enable enhanced decision making, insight discovery and process optimization."

Big Data is described within the Gartner definition based on the three Vs:

  •  Volume: Size of data (how big it is)
  •  Velocity: How fast data is being generated
  •  Variety: Variation of data types to include source, format, and structure

In terms of the three Vs, the Gartner definition effectively says that:
"There is a lot of data, it is coming into the system rapidly, and it comes from many different sources in many different formats."

IT companies are investing billions of dollars into research and development for Big Data, Business Intelligence (BI), data mining, and analytic processing technologies. This fact underscores
the importance of accessing and making sense of Big Data in a fast, agile manner.
Big Data is important; those who can harness Big Data will have the edge in critical decision making. Companies utilizing advanced analytics platforms to gain real value from Big Data will grow faster than their competitors and seize new opportunities.

To support Big Data, modern analytic processing tools must .

  • Shift away from traditional, rearward-looking BI tools and platforms to more forward-thinking analytic platforms.
  • Support a data environment that is less focused on integrating with only traditional, corporate data warehouses and more focused on easy integration with external sources.
  • Support a mix of structured, semi-structured, and unstructured data without complex, time Consuming IT engineering efforts.
  • Process data quickly and efficiently to return answers before the business opportunity is lost.
  • Present the business user with an interface that doesn't require extensive IT knowledge to operate.

The if/else Construct in Java Example

 public class IfElseElevator {

 public boolean doorOpen=false; // Doors are closed by default
 public int currentFloor = 1; // All elevators start on first floor
 public final int MAX_FLOORS = 10;
 public final int MIN_FLOORS = 1;

 public void openDoor() {
 System.out.println(“Opening door.”);
 doorOpen = true;
 System.out.println(“Door is open.”);
}

 public void closeDoor() {
 System.out.println(“Closing door.”);
 doorOpen = false;
 System.out.println(“Door is closed.”);
 }

 public void goUp() {
 System.out.println(“Going up one floor.”);
 currentFloor++;
 System.out.println(“Floor: “ + currentFloor);
 }

 public void goDown() {

 if (currentFloor == MIN_FLOORS) {
 System.out.println(“Cannot Go down”);
}

else {
 System.out.println(“Going down one floor.”);
 currentFloor--;
 System.out.println(“Floor: “ + currentFloor);
 }
 }

 public int getFloor() {

 return currentFloor;
 }

 public boolean checkDoorStatus() {
 return doorOpen;
 }
 }

Product Life Cycle (PLC) Stages


The Product Life Cycle (PLC) is based upon the biological life cycle. For example, a seed is planted (introduction); it begins to sprout (growth); it shoots out leaves and puts down roots as it becomes an adult (maturity); after a long period as an adult the plant begins to shrink and die out (decline).


  • Each product may have a different life cycle
  • PLC determines revenue earned
  • Contributes to strategic marketing planning
  • May help the firm to identify when a product needs support, redesign, reinvigorating, withdrawal, etc.
  • May help in new product development planning
  • May help in forecasting and managing cash flow

1. Analysis
2. Design
3. Development
4. Testing
5. Implementation
6. Maintenance
7. End-of-life (EOL)