Posts

Showing posts from 2017

Memorization Technique

Image

Soalan Ulangkaji Queue

Soalan ulangkaji queue link1 Soalan ulangkaji queue link2

Java precedence

Level Operator Description Associativity 16 [] . () access array element access object member parentheses left to right 15 ++ -- unary post-increment unary post-decrement not associative 14 ++ -- + - ! ~ unary pre-increment unary pre-decrement unary plus unary minus unary logical NOT unary bitwise NOT right to left 13 () new cast object creation right to left 12 * / % multiplicative left to right 11 + - + additive string concatenation left to right 10 << >> >>> shift left to right 9 < <= > >= instanceof relational not associative 8 == != equality left to right 7 & bitwise AND left to right 6 ^ bitwise XOR left to right 5 | bitwise OR left to right 4 && logical AND left to right 3 || logical OR left to right 2 ?: ternary right to left 1  =   +=   -= *=   /=   %= &=   ^=   |= <<=  >>= >>>= assignment right to left Resource: https://introcs.cs.princeton.edu/java/11precedence/

video infix prefix postfix

Image

Soalan Ulangkaji(Stack)

Ulangkaji Stack link 1 Ulangkaji Stack link 2

DataSructure Lab 6

Laboratory Sheet 6 1.        Write a method to generate 1000 numbers between 1-1000. Use random number generator. Store the numbers in an array of integer. 2.        Write a method to sort numbers generated in 1. Implement selection sort . 3.        Write a method to sort numbers generated in 1. Implement bubble sort . 4.        Write a method to sort numbers generated in 1. Implement linear insertion sort . 5.        Compare the time taken to sort 1000 numbers between the three methods. 6.        Repeat 1-5, with 15000 numbers.

clock

Basic Web Page 1

Image

java code round to two decimal place

Method 1: x = (double)int((x+0.005)*100.0)/100.0; Method 2: x = Math.round(x*100.0) / 100.0; Method 3: DecimalFormat df2 = new DecimalFormat( "#,###,###,##0.00" ); double dd = 100.2397; double dd2dec = new Double(df2.format(dd)).doubleValue(); Method 4: f = (float) (Math.round(n*100.0f)/100.0f); Method 5: double r = 5.1234; System.out.println(r); // r is 5.1234 int decimalPlaces = 2; BigDecimal bd = new BigDecimal(r); bd = bd.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); // setScale is immutable r = bd.doubleValue(); System.out.println(r); // r is 5.12 source:  http://salmanjamali.blogspot.my/2008/01/java-rounding-off-to-2-decimal-places.html            :http:// www.thescripts.com

video stack

Image
Video Stack

Markah Kumpulan Struktur Data dan Algoritma 2017

Sila masukkan senarai ahli kumpulan anda di sini link

Diagnostik Test

Sila download soalan diagnostik di ruangan di bawah soalan diagnostik link2 link3

contoh JOptionPane

import javax.swing.*; /** * JOptionPane showInputDialog example #1. * A simple showInputDialog example. * @author alvin alexander, http://alvinalexander.com */ public class JOptionPaneShowInputDialogExample1 { public static void main(String[] args) { // a jframe here isn't strictly necessary, but it makes the example a little more real JFrame frame = new JFrame("InputDialog Example #1"); // prompt the user to enter their name String name = JOptionPane.showInputDialog(frame, "What's your name?"); JOptionPane.showMessageDialog(frame,"my name is "+name); // get the user's input. note that if they press Cancel, 'name' will be null System.out.printf("The user's name is '%s'.\n", name); System.exit(0); } } //original source: http://alvinalexander.com/java/joptionpane-showinputdialog-examples

Makmal OOP 11/mei/2017

Oleh kerana semua staff ppimg tiada di pusat pengajian. Makmal pada hari ini ditangguhkan. Diminta semua pelajar menyiapkan tugasan makmal untuk mimggu ini dan upload ke mylearn seperti biasa . Terima kasih

tutorial 4 mei

http://192.168.30.139:8080/ WebApplication2/tutorial4mei. pdf

Tutorial 27 April 2017

Sistem maklumat pelajar dan staff UMT -Boleh rekod maklumat staff dan pelajar -Print maklumat pelajar dan staff. Untuk pelajar perlu rekod maklumat nama, ic, alamat, no tel, umur, no matrik, nama kursus Untuk staff perlu rekod maklumat nama, ic, alamat, no tel, umur, nama pejabat, nama jawatan Alamat ada mklumat nama, alamat, poskod, daerah, negeri dan negara -mesti ada inheritance dan aggregation * Sediakan UML class diagram * Tulis coding penuh bagi sistem ini * input 5 nama pelajar dan staff * output maklumat pelajar dan staff

tutorial oop 20/April/2017

Click link below to access tutorial question link 1 to tutorial link 2 to tutorial Thank you.

contoh enum

//contoh enum //source:https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html /*  * To change this license header, choose License Headers in Project Properties.  * To change this template file, choose Tools | Templates  * and open the template in the editor.  */ package javaapplication1; /**  *  * @author Makmal PPIMG  */ public enum NewEnum {    MERCURY (3.303e+23, 2.4397e6),     VENUS   (4.869e+24, 6.0518e6),     EARTH   (5.976e+24, 6.37814e6),     MARS    (6.421e+23, 3.3972e6),     JUPITER (1.9e+27,   7.1492e7),     SATURN  (5.688e+26, 6.0268e7),     URANUS  (8.686e+25, 2.5559e7),     NEPTUNE (1.024e+26, 2.4746e7);         private final double mass;   // in kilograms     private final double radius; // in meters         //constructor mesti sama type dengan enum      NewEnum(double mass, double radius) {         this.mass = mass;         this.radius = radius;     }      public double getMass(){          return mass;      } //main method b

session tracking for logOut

<%          String email = ( String ) session . getAttribute ( "email" ) ;                   / / redirect user to home page if already logged in          if ( email != null ) {              response . sendRedirect ( "home.jsp" ) ;          }          String status = request . getParameter ( "status" ) ;                   if ( status != null ) {              if ( status . equals ( "false" ) ) {                    out . print ( "Incorrect login details!" ) ;                                      }              else {                  out . print ( "Some error occurred!" ) ;              }          }          %> resource: http://www.thecrazyprogrammer.com/2016/03/jsp-login-logout-system-example-using-session.html

Form untuk submit markah code hunt

Submit markah code hunt di sini

Ulangkaji Lab4(santai-santai)

Jom ulangkaji java sambil bermain.Masa diperuntukkan 30 minit sahaja. Have fun. Seterusnya sila siapkan tutorial makmal yang telah diupload dalam e-pembelajaran. Terima kasih. Game Java

survey OOP1

Mohon lengkapkan soal selidik ini. Soal selidik OOP1 Terima kasih

ulangkaji oop lab 3

ulangkaji oop lab 3 link 1 ulangkaji oop lab 3 link 2

LAB 2 OOP

Lab 2 oop Sila dapatkan tutorial oop di link di bawah lab 2 oop  link 1 lab 2 oop link 2

ulangkaji oop lab2

link ke ulangkaji oop lab2 link ke ulangkaji oop lab2