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

5/10/2017

BCS2233 OOP : Lab 11 Mei 2017

1 Berikut adalah flowchart dan program java untuk permainan meneka nombor (di ambil dari 05slide.ppt, slaid nombor 17) . 



Sedikit perubahan (teks biru) telah di buat terhadap terhadap perjalanan permainan ini sebagai mana yang di tunjukkan pada flowchart di bawah. Ubah suai program java di atas.

2. (Count positive and negative numbers and compute the average of numbers) Write
a program that reads an unspecified number of integers, determines how many
positive and negative values have been read, and computes the total and average of
the input values (not counting zeros). Your program ends with the input 0. Display
the average as a floating-point number. Here is a sample run:


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