6/07/2017

BCS2233 OOP. Lab 8 Jun 2017

Chapter 9 : Objects and Classes
Give both traditional and Object Oriented approach solution for the following problems.
 
1.    Write a java program that reads the length and height of a rectangle and computes its area and parameter using the following formulas:-
Area = length x height
Perimeter = 2 x (length + height)



OOP:

2.    Write a java program that reads the height of a cube  and computes its area and parameter using the following formulas:-
Area = height2
Perimeter = 4 x height

TRA:



3.    Write a program that reads in the radius and length of a cylinder and computes its volume using the following formulas:

Area = radius * radius * 3.14
Volume = area * length


TRA:


 

5/31/2017

BCS2233 OOP. Lab 1 Jun 2017

1. Show output of the following java program.
 click here to download the file.
 
public class demomethod2 {
    
    public static void main(String[] args) {
    ucapan("Selamat Berpuasa");
    kepala();
    tangan();
    badan();
    kaki();
    ucapan("Maaf Zahir Batin");
   
    }

public static void kepala(){
        System.out.println("      *");
    System.out.println("    *   *");
    System.out.println("   * O O *");
    System.out.println("  *   |   *");
    System.out.println("   *  _  *");
    System.out.println("    *   *");
    System.out.println("      **");
}

public static void tangan(){
System.out.println("***************");
}

public static void badan(){
        System.out.println("      **");
    System.out.println("      **");
    System.out.println("      **");
    System.out.println("      **");
}
public static void kaki(){
        System.out.println("     ** **");
    System.out.println("    **   **");
    System.out.println("    **   **");
    System.out.println("    **   **");
    System.out.println("  ****   ****");
}

public static void ucapan(String msg ){
int i;
for (i=1;i<=3;i++){
System.out.println(msg);
}
}

}

 2. Write method headers for the following methods: 

a. Computing a sales commission, given the sales amount and the commission rate.

b. Printing the calendar for a month, given the month and year.

c. Computing a square root.

d. Testing whether a number is even, and returning true if it is.

e. Printing a message a specified number of times.


3. Implements a method for Question 2 a,d and e. Write a test program that invokes these methods.

4. (Conversions between feet and meters) Write a class that contains the following
 method:

/** Convert from feet to meters */
public static double footToMeter(double foot)

The formula for the conversion is:
foot = 3.279 * meter
Write a test program that invokes these methods to display the following tables:











5/17/2017

BCS2233 OOP. Lab 17, 18 Mei 2017

1. Write a java program for the following problems:-

i) Print 1,2,3..20 using while loop
ii) Print 1,2,3..20 using do..while loop
iii) Print 1,2,3..20 using for loop

2. (Conversion from kilograms to pounds) Write a program that displays the following table (note that 1 kilogram is 2.2 pounds). The flowchart has been prepared for you.


Kilograms           Pounds
1                          2.2
3                          6.6
...
197                    433.4
199                    437.8






3. (Conversion from miles to kilometers) Write a program that displays the following table (note that 1 mile is 1.609 kilometers):  Prepare the flowchart first prior to java program.

Miles Kilometers
1 1.609
2 3.218
...
9 14.481
10 16.090

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