12/06/2014

BCS2233 OOP: Assignment 3

ASSIGNMENT 3

1. An object represents an entity in the real world and it has state, and behaviors. Define state and behaviour.

2. What is the difference between class and object.

3. What is the difference between overloading and over riding.

4. Define superclass and subclass.


2.  (The Rectangle class) Design a class named Rectangle to represent a rectangle. The class contains:
Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height.

A string data field named color that specifies the color of a rectangle. Hypothetically, assume that all rectangles have the same color. The default color is white.

A no-arg constructor that creates a default rectangle.

A constructor that creates a rectangle with the specified width and height.

A method named getArea() that returns the area of this rectangle.

A method named getPerimeter() that returns the perimeter.

 Draw the UML diagram for the class. Implement the class. Write a test program that creates two Rectangle objects. Assign width 4 and height 40 to the first object and width 3.5 and height 35.9 to the second object. Assign color red to all Rectangle objects. Display the properties of both objects and find their areas and perimeters.

DCT1093 OOP : LAB 1

Question 2.1 
import java.util.Scanner;
public class ooplabweek1g2 {
   
    public static void main(String[] args) {
        double celsius;
        double fah;
        Scanner input = new Scanner(System.in);
        celsius = input.nextInt();
        fah = (9/5) * celsius + 32;
        System.out.println(fah);
    }
}


 Question 2.2

  import java.util.Scanner;
public class ooplabweek1q2 {
  
    public static void main(String[] args) {
      
        int radius, length;
        double area,volume;
        Scanner input = new Scanner(System.in);
        System.out.println("sila masukkan nilai jejari dan panjang silinder:");
        radius = input.nextInt();
        length = input.nextInt();
        area = radius*radius*3.14;
        volume = area * length;
        System.out.println("Isipadu silinder =:" + volume);
    }
}

12/03/2014

BCS3473 OOADD UML Diagram

Please visit the following sites for UML Diagram tutorials.

2. Lucidchart.com
3. Tutorialspoint.com

Some of the most important diagrams that students need to familiar with are as follows:-

I. Use case Diagram
II. Activity Diagram
III. Communication Diagram
IV. Class Diagram
V. Sequence Diagram

12/01/2014

BCS3473 OOADD Chapter 5:Modelling Concepts, 6: Requirenments Capture, 7: Requirements Analysis

Review Question


Chapter 5: Modelling Concepts

I. What is the different between a diagram and a model?
II. What are the four elements of a UML diagram?
III. Why do we use models in developing computerized information system and other artefacts?

Chapter 6: Requirenments Capture

I. Name the five main fact-finding techniques and list one advantages and one disadvantages of each.
II. What is the purpose of producing the use cases?
III. Describe in your own words the differences between the <> and <> relationships in use case diagrams.


Chapter 7: Requirements Analysis

I. Explain what is meant by 'use case realization'
II. Distinguish between attribute and value
III. Distinguish between link and association.
IV. What is multiplicity.

11/30/2014

BCS2233 OOP:Lab 1 Dis - 4 Dis 2014

Write  a java program for the following problems using object oriented approach. 

1.  Develop a program to input height and length of a right triangle and calculate and print the area of a right triangle.

        Area of right triangle = (height x length) /2


2. Write a java program to input three integers and print the smallest and largest.


3.  An electric supply company charges the following rates for its customers:-

No. of unit consumed                              Charges/unit (RM) 
1     - 200                                                           0.218 
201 - 300                                                           0.334                                                   
>= 301                                                               0.516

Read unit consumed and calculates the net amount of the bill for each consumer and print it.








BCS2233 Chapter 8: Classes and Objects

Write a java program using both  structured and Objected Oriented approach to input length and width of a rectangle and calculate its area and parameter.
-------------------------------------------------Structured------------------------------------------
import java.util.Scanner;
public class calculateAreadanPerimeterofBox {
    
    public static void main(String[] args) {
    Scanner input= new Scanner(System.in);
    System.out.println("Sila Masukkan nilai tinggi dan lebar segiempat!");
        int tinggi = input.nextInt();
        int lebar =input.nextInt();
        
        int luasSegiempat=tinggi*lebar;
        int perimeterSegiEmpat = 2*(tinggi+lebar);
        
          System.out.println("Tinggi : " +tinggi);
         System.out.println("Lebar : " +lebar);
        System.out.println("Luas Segi Empat=" +luasSegiempat );
        System.out.println("Perimeter Segi Empat=" +perimeterSegiEmpat );
  }
}

----------------------------------------------------------------------------------------------------------------


-------------------------------------------------Object Ortiented ------------------------------------------
import java.util.Scanner;
class segi4{
int luas,perimeter, lebar,tinggi;

void baca_data(){
Scanner input= new Scanner(System.in);
System.out.println("Sila masukkan lebar dan tinggi bagi suatu segi empat :");
lebar=input.nextInt();
tinggi=input.nextInt();
}

void kira_luas(){
luas = lebar * tinggi;
}

void kira_ukurlilit(){
perimeter=(lebar + tinggi)*2;

}

void pamir_data(){
System.out.println("lebar: "+lebar);
System.out.println("tinggi:"+tinggi);
System.out.println("luas:"+luas);
System.out.println("Ukur Lilit / Perimeter : "+perimeter);
}

}
 
public class demoClass_and_Object {
    
    public static void main(String[] args) {
   
    segi4 mys4 =new segi4();
        mys4.baca_data();
        mys4.kira_luas();
        mys4.kira_ukurlilit();
        mys4.pamir_data();

    
    }
}

----------------------------------------------------------------------------------------------------------------

11/16/2014

BCS3473 OOAD Test 1 Preparation

Contoh Soalan Ujian 1

Chapter 1
What is the differences between an information systema dn information technology?
What is the purpose of a management support system.
Define information. How does it differs from data?

Chapter 2
What is the main underlying causes of probels in information systems development?
What is the main differences between quality problems and productivity problems?
Define stakeholder.

Chapter 3
What are the advantages of the traditional waterfall lifecycle?
What are the disadvantages of the traditional waterfall lifecycle?
What is prototyping?
How does prototyping differs from inceremental development?

Chapter 4
What is polymorphism?
What does it mean to say that an object oriented is highly modular?

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...