Saturday, July 18, 2009
i-learn run me crazy....
this sem gone be very hard time 4 me i think, i took 7 subject (proposal+it project,techno,Kb,Language,NN and Dss)and sure have to do lots of coding. pre proposal juz started in sem break last sem...i'm doing on "malay grammar checker uisng NLP" and i do submitted the pre-proposal.
the class was started last 2 week ago. And this weekend i have 2 assignment to finish. 1 was done last 2 days. And i think need to finish the last one today, but as i said the system does not working well, don't know how to finish the work without the report from past semester. i can't download the report la way...tell me how? where can i get the resource... waaa...... tansion mcm ni.
plz maintain the system la admin. sometime i think all of this create more trouble to us.dah la susah nak wat keje klo system down. x tau la aper nak ckp dah.. geram tahap dewe dah.
meluahkan ketdk puashatian
city
Tuesday, June 23, 2009
kelantanese cuisine
Let me list down few of most famous kelantanese food:
1. Nasi kerabu (most favorite to eat)
2. Nasi dagang ( brown rice eat with ikan tongkol)
3. Laksam ( kuah lemak waa.. so delicious )
4. Percik (fish and chicken)
5. Solok (cili sumbat)
6. And kelantanese trade mark Budu with some ulam (the most delicious food)
7. Etak
And tell u before right, kelantanese use sugar especially when preparing kuih. It tremendously use lots of sugar. May be who are not use to eat kelantanese kuih, the name should be sound freak to them. But tell u have to try kelantanes kuih, it delicious, u wouldn’t forget once u try it.
Some of the famous kuih are:
1. Ketupat sotong (pulut in the sotong he3 unfamiliar right?) and ketupat palas
2. Puteri mandi
3. Jala emas and buah tanjung
4. Butir nako
5. Akok
6. Tahi itik
7. Lompat tikam
hu3... lots more to list down... but if you visit kelantan don't forget try all this food...and then leave me some comment
ermm juz finish final exem for short coz
1. Eco 415
2.Its 610
urmmmm... study about 5 week and after that seat for final exam. Quite hectic schedule...
Its 610 lec by PM Hanafiah Harun. The way he talk was very good, ct bg dia goodest la....he3. lots of mission to accomplish, he is really protecting Malay best sgt klas dia but ct ponteng 1 hari kui3... I have to finish 3 assignments which are for the first is individual and the second and third 2 for grouping. For individual I work on telecommuting advantages and disadvantages. 1st group we were working on ethic in it, my part was about e commerce. For the last assignment group we have to do a analysis about cellphone. i have to do collecting information which is let people answer the questionair.I gave it to my friends to do the question. Thanks for the help me. I worked on scope of the study and the methodology.
For the economic, think it something interesting to study on, lots of information and knowledge i gain from the class. And pn siti ayu was superb when talking about economic, make me astonishing when a moment she opened her mouth. We were assigning to work on ASEAN import export and gdp. ermm lot of reading to do but it really opened my eyes when do the reading on that subject.
Friday, June 19, 2009
Eat alway a pleasure
1. Bubur nasi (Anis sup utara)yummy... but sometime the soup lost the taste, water to much
2. Fresh orange (side walk) but if u in a group better order only one
3.Roti canai (the sambal so good)
3. kerabu mangga (Restaurant umi)
4. Bancau (Anis sup utara)
5. Yong tau fu ( satu2 nyer chinese Restaurant) soup so good and the deep fried brinja
* not real pictures... latter when i went for this thing... i'll give a snap..he3
ermm... this juz a few... latter after i tried something is good and i'll give some post, he3.
klo x sedap jgn marah.... for me the taste not bad laaa...., make me remember on the food...don't forget to leave a comment. :-p
Saturday, June 13, 2009
Have fun 2day
tambah2 plak haze skg ni.even at 12pm pon can not see clear. last night watched news shah alam in 98 effected. but the most is klang valley la , so bad reach till 132. erm they said because of the weather now (lanina kut hu3).
this morning went to taman bukit cahaya. reach there almost 11am. though want to cycle after taking bus looking around the place. but the weather getting darker hurmmm. biler jer turun bus...taram raining.... cam hujan to chasing over us plak. hacus harapan nak cycling.
pas 2 boleh still palying plak, melengang...biler jer kuar jer pintu kuar taman 2, is geting worse. so per g....belari cam kejar dgn anjing lo... betempiaran looooo... sampai jer kat kete...sume dah lencun... lounging each other la.
punyer la bwk byk makanan. fried rice, porridge, sandwich, buah melaka... at last eat all that in the car...kui3.After that don't know wht 2 do, make mind to go sunway...actually dah ready siap bwk jeans and make up g. berenti kat "The Run" change everything, macam transformer plak, from track suit to casual. Yuhooo girls day out.
sampai sunway almost 12 something and go jln2 jer. no money no talk beb. juz window shopping jer. cuci mater jer. look around till 3 something and balik umh lo... sambil 2 mencekik lagi dlm kete. have some fun 2day. thanks farah bring me out 2day. love u muah.he3...
love
ct
Friday, June 12, 2009
Makna bacaan dalam solat.
Doa Iftitah
Allah Maha Besar dan segala puji bagi Allah dengan banyaknya.
Maha suci Allah sepanjang pagi dan petang.
Aku hadapkan wajahku bagi Tuhan yang mencipta langit dan bumi,
dengan suasana lurus dan berserah diri dan aku bukan dari golongan orang musyrik.
Sesungguhnya solatku,
Ibadatku,
hidupku,
matiku
adalah untuk Allah Tuhan sekelian alam.
Tidak ada sekutu bagiNya dan kepadaku diperintahkan untuk tidak
menyekutukan bagiNya dan aku dari golongan orang Islam.
Al-Fatihah
Dengan nama Allah yang maha Pemurah lagi maha Mengasihani.
Segala puji bagi Allah, Tuhan semesta alam.
Yang maha pemurah lagi maha mengasihani.
Yang menguasai hari pembalasan.
Hanya Engkaulah yang kami sembah dan hanya kepada Engkau kami mohon pertolongan.
Tunjukilah kami jalan yang lurus.
Iaitu jalan orang-orang yang Engkau kurniakan nikmat kepada mereka, bukan jalan mereka yang Engkau murkai dan bukan jalan mereka yang sesat.
Bacaan ketika rukuk
Maha Suci TuhanKu Yang Maha Mulia dan dengan segala puji-pujiannya.
Bacaan ketika bangun dari rukuk
Allah mendengar pujian orang yang memujinya.
Bacaan ketika iktidal
Wahai Tuhan kami, bagi Engkaulah segala pujian.
Bacaan ketika sujud
Maha suci TuhanKu yang Maha Tinggi dan dengan segala puji-pujiannya.
Bacaan ketika duduk di antara dua sujud
Ya Allah, ampunilah daku,
Rahmatilah daku,
kayakan daku,
angkatlah darjatku,
rezekikan daku,
berilah aku hidayah,
sihatkanlah daku dan
maafkanlah akan daku.
Bacaan ketika Tahiyat Awal
Segala penghormatan yang berkat solat yang baik adalah untuk Allah.
Sejahtera atas engkau wahai Nabi dan rahmat Allah serta
keberkatannya.
Sejahtera ke atas kami dan atas hamba-hamba Allah yang soleh.
Aku naik saksi bahawa tiada Tuhan melainkan Allah dan aku naik saksi bahawasanya Muhammad itu adalah pesuruh Allah.
Ya Tuhan kami, selawatkanlah ke atas Nabi Muhammad.
Bacaan ketika Tahiyat Akhir
Segala penghormatan yang berkat solat yang baik adalah untuk Allah.
Sejahtera atas engkau wahai Nabi dan rahmat Allah serta keberkatannya.
Sejahtera ke atas kami dan atas hamba-hamba Allah yang soleh.
Aku naik saksi bahawa tiada Tuhan melainkan Allah dan aku naik saksi bahawasanya Muhammad itu adalah pesuruh Allah.
Ya Tuhan kami, selawatkanlah ke atas Nabi Muhammad dan ke atas keluarganya.
Sebagaimana Engkau selawatkan ke atas Ibrahim dan atas keluarga Ibrahim.
Berkatilah ke atas Muhammad dan atas keluarganya sebagaimana Engkau berkati ke atas Ibrahim dan atas keluarga Ibrahim di dalam alam ini.
Sesungguhnya Engkau Maha Terpuji lagi Maha Agung.
Doa Qunut
Ya Allah, berilah aku petunjuk sebagaimana orang-orang yang telah Engkau tunjuki.
Sejahterakanlah aku sebagaimana orang-orang yang telah Engkau sejahterakan.
Pimpinlah aku sebagaimana orang-orang yang telah Engkau pimpin.
Berkatilah hendaknya untukku apa-pa yang telah Engkau berikan padaku.
Jauhkanlah aku daripada segala kejahatan yang telah Engkau tetapkan.
Sesungguhnya hanya Engkau sahajalah yang menetapkan, dan tidak sesiapapun yang berkuasa menetapkan sesuatu selain daripada Engkau.
Sesungguhnya tidak terhina orang yang memperolehi pimpinanMu.
Dan tidak mulia orang-orang yang Engkau musuhi.
Telah memberi berkat Engkau, ya Tuhan kami dan maha tinggi Engkau.
Hanya untuk Engkau sahajalah segala macam puji terhadap apa-apa yang telah Engkau tetapkan.
Dan aku minta ampun dan bertaubat kepada Engkau.
Dan Allah rahmatilah Muhammad, Nabi yang ummi dan sejahtera keatas keluarganya dan sahabat-sahabatnya.
Really hard time to go
I think i have spend lots of time for something that I'm not really sure on. waiting and hoping on something is not clear for me, it like a I'm in the a thick folk, trying to find a way out. So i take this chances to make it more clear, trying the best way out, the best decision from getting lost in my dream.
I need time and space for my self. Doing what should i done before. Having my time to spend on my interest, my friends, my normal activity. Day by day i getting more clear and clear, less doubting than before. Alhamdulilah thanks to almighty god. I fell more comfort, know who i am and what really i want to be.
I'm asking an advise people around me, what are their opinion on my situation. alhamdulilah I think what they had said is helping me. It is giving me how I'm going to solve with this problems.
love
city
Saturday, June 6, 2009
Dammly miss ipoh.....
let me list u the restaurants
1. The Mackcik stall in pekan razaki (laksa).
2. The mouth (Chinese food)
3. Old town (law shi fan)
4. Dataran (a fordable price )
5. Pakcik stall juz behind night market site(kuew tiaw kong fuu),i can show u the stall
6. Nasi belauk in stadium (taste so good)
8. Tasik banding retaurances (nasi campur)
9. Wadie in stadium
10.Benteng nasi goreng kuali
11.Benteng restaurance (in kuala kangsar)
12.Kampai (Japanese food)
tell u it licking finger... i love all that food so much. go to perak don't miss all this food. you better go for that.
ipoh juz like a small town but it juz a nice town to leave. min traffic jam but lots of necessity. such a nice place to live. for anybody want to go there jangan luper ajak tau....miss u so much ipoh.
Sunday, May 31, 2009
i in still seaching who i am
uhhhm... so hard to survive. sometime got so blur...who I'm gone be. in d age of 22nd still finding my identity, the way i perform my self, the way i present to the people....still in searching. sometime i need a person who can guide me, tell me, advise me to follow the right way... and I'm glad to have them...and i would like to say thanks....
People come and people go And people gonna come some more...and they teaching me to be who i am now. lots i can see,lots i can make as guided for me. what should i do, and i shouldn't.
lots of people i can see, bad one, good... umhhh i chose to a be good one. insyallah my god bless me, may god pelihara aku. i pray for that. peliharlah aku dari semua kemungkaran perkara yang engkau laknat, kuatkan iman aku. "amin ya robal alamin"
Sunday, May 24, 2009
My GA
/**
* Write a description of class minipro here.
*
* @author (Siti Asmah Ab Aziz & Siti Farah Diana bt Yusoff)
* @version (BinaryTournament )
*/
import javax.swing.*;
import java.util.*;
import java.math.*;
import java.io.*;
public class miniproBinaryTournament
{
public static void main(String[]args)throws IOException
{
PrintWriter print = null;
try // try clause
{
String filename=JOptionPane.showInputDialog(null,"Enter name of file for output result"); //location for output to display
print = new PrintWriter(new FileOutputStream(filename+".txt"));
String tit=JOptionPane.showInputDialog(null,"Enter number of title offered");
int title=Integer.parseInt(tit);
String stud=JOptionPane.showInputDialog(null,"Enter Number of Student");
int student=Integer.parseInt(stud);
String pop=JOptionPane.showInputDialog(null,"Enter Number of population ");
int population=Integer.parseInt(pop);
String gen=JOptionPane.showInputDialog(null,"Enter Number of generation ");
int generation=Integer.parseInt(gen);
//number of student
Random generator = new Random();
int[][] aMatrix = new int[student][4];
String out="";
// populate matrix
for (int i = 0; i <>
for (int j = 0; j <>
//number of assignment
//String assign=JOptionPane.showInputDialog(null,"Enter Number of assignment you prefer student no: " +(i+1));
//int assignment=Integer.parseInt(assign);
//int index=j+1;
int r=generator.nextInt(title);
if(r ==1)
{
aMatrix[i][j] = r;
}else
{
aMatrix[i][j] = r;}
}
}
// print matrix
print.println("Student"+"\t First Choice"+" \t Second Choice"+" \t Third Choice");
print.println("_____________________________________________________________");
for (int i = 0; i
print.println(i+1+".");
for (int j = 0; j <>
}
print.println();
print.println("_____________________________________________________________");
}
print.println();
//create chromosome
int prio=0;
int choosenP=0;
int []chromosom=new int [student];
int [] a=new int[3];
int[][] aMatrix2 = new int[student][4];
int[][] aMatrix3 = new int[student][4];
String[][] aMatrix4 = new String[student][4];
int[][] aMatrix5 = new int[population][student];
int[][] aMatrix6 = new int[population][student];
boolean found=false;
int count=0;
int asign=0;
int asign2=0;
int asign3=0;
int asign4=0;
int asign5=0;
int title2;
int asignOr2=0;
int asignOr3=0;
int asignOr4=0;
int asignOr5=0;
boolean found2=true;
boolean found3=true;
int index1=0;
int index2=0;
int add=0;
int answer=0;
int combine=0;
int total=0;
//store in new array for index 0
for(int gene=0;gene
//population
for(int Inipop=0;Inipop
else
{
for(int i=0;i
if(aMatrix2[chL1-(i+1)][0]!=aMatrix[chL1][0])
{
asignOr=aMatrix[chL1][0];
//asignment no
aMatrix2[chL1][0]=asignOr;
//value count fitness
aMatrix2[chL1][1]=1;
// print.println(aMatrix2[chL1-(i+1)][0]+" is not =="+aMatrix[chL1][0]);
}
else {
asignOr=aMatrix[chL1][1];
// print.println(aMatrix2[chL1-(i+1)][0]+"=="+aMatrix[chL1][0]);
// print.println("second choice "+asignOr);
for(int s=0;s
// print.println(aMatrix2[chL1-(s+1)][0]+" is not =="+asign2);
}
else
{
//found = true;
asign3=aMatrix[chL1][2];
// print.println(aMatrix2[chL1-(i+1)][0]+"=="+aMatrix[chL1][0]);
// print.println("third choice "+asign3);
for(int j=0;j
if(r!=aMatrix2[chL1-(ran+1)][0])
//print.println("random number masuklah");
aMatrix2[chL1][0]=r;
aMatrix2[chL1][1]=4;
}break;
}
}break;}
} break;
}
}
}
add=aMatrix2[chL1][1];
// print.println("priority value "+add);
combine=aMatrix2[chL1][0];
print.println((chL1+1)+ " get project no: "+aMatrix2[chL1][0]);
print.println(" ");
count ++;
//value add of priority in chromosome
fitness+=add;
aMatrix2[chL1][2]=fitness;
answer= aMatrix3[chL1][0];
Cfit +=" "+aMatrix2[chL1][0];
//store assignment
aMatrix5[Inipop][chL1]= aMatrix2[chL1][0];
//store priority
aMatrix6[Inipop][chL1]= aMatrix2[chL1][1];
// print.println("priority value "+ aMatrix6[Inipop][chL1] );
}
print.println("kumpulkan "+Cfit);
//store
aMatrix4[Inipop][0]= Cfit ;
print.println(" fitness "+Inipop+": "+fitness);
aMatrix3[Inipop][0]=fitness;
// print.println("jawapan fitness..... "+ aMatrix3[Inipop][0]);
print.println("");
print.println("");
}
/********************Binary tournament********************/
/*************** 1st random number of choosen value**********************************************************/
int randomCv;
int nV=0;
int indexR;
String radomVal="";
int tempVal;
String tempRAn;
int valueR=0;
boolean ran1=false;
boolean ran2=false;
int randomvalue1[]=new int[10];//store value random1
int randomvalue2[]=new int[10];//store value random2
int min1=aMatrix3[0][0];
int min2=aMatrix3[0][0];
randomCv=generator.nextInt(population);
print.println("random Value : "+ randomCv);
if (randomCv>=2)
{
for (int randomLoop=0;randomLoop
indexR=generator.nextInt(population-1);
tempVal=aMatrix3[indexR][0];
// value=Integer.parseInt(tempVal,2);
radomVal+= "\t"+tempVal;
print.println("jawapan storage 2: "+tempVal);
for(int minSearch=0;minSearch<>=aMatrix3[minSearch][0])
{
min2=min1;
min1=aMatrix3[minSearch][0];
index2=index1;
index1=minSearch;
}
else if(min1>=aMatrix3[minSearch][0])
{
min2=aMatrix3[minSearch][0];
index2=minSearch;
}
}
}
print.println( " ");
print.println("minimum 1: "+min1);
print.println("index1: "+(index1));
print.println("minimum 2: "+(min2));
print.println("index2: "+ (index2));
// print.println("\n");
// print.println("\n");
}
else
{ran1=true;
String buz = "no random value";
print.println(buz);
print.println("\n");
}
/********************call cromosome choosen*******************************/
if(ran1==false)
{
int save=0;
int[] array1 = new int [student];//array isi chromose1 yang terpilih max1
int[] array2 = new int [student];//array isi chromose2 yang terpilih max2
int[] array3 = new int [student];
int[] array4 = new int [student];
print.println("_______________________________________________________________________________________________________________________________________");
print.println("Population "+" "+" Chromosome "+"\t"+"\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "fitness ");
print.println("_______________________________________________________________________________________________________________________________________");
for(int call=0;call
// save=aMatrix2[call1][0];
print.print(" "+ aMatrix4[call][0]);
print.print("\t"+"\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+"\t"+ "\t"+ "\t"+ "\t"+ "\t"+ "\t"+ aMatrix3[call][0]);
print.println("");
}
print.println("_________________________________________________________________________________________________________________________________");
//chromosome the most minimum and 2nd minimum in population
//first index
//index 1(chromosome)
print.print(" chromosome index1 ");
for(int mini=0;mini
for(int min=0;min
print.print(aMatrix5[mini][min]+" ");
array1[min]=aMatrix5[mini][min];
}
}
}
//proirity index 1
for(int mini=0;mini
for(int min=0;min
//print.print(aMatrix6[mini][min]+" ");
array3[min]=aMatrix6[mini][min];
}
}
}
print.println(" ");
//index 2 (chromosome)
print.print(" chromosome index2 ");
for(int mini=0;mini
for(int min=0;min
print.print(aMatrix5[mini][min]+" ");
array2[min]=aMatrix5[mini][min];
}
}
}
//proirity index 2
for(int mini=0;mini
for(int min=0;min
//print.print(aMatrix6[mini][min]+" ");
array4[min]=aMatrix6[mini][min];
}
}
}
/****************************************************************UNIFORM CROSSOVER*************************************************/
Random y = new Random();
print.println("");
int [] ans = new int [student];//panjang allele 123456
int q=0;
int [] priority = new int [student];
for(int r= 0;r
print.println("");
print.println("");
/**************************************************MUTATION SWAPPING (PENIPU)********************************************************/
int loc1 =0;
int loc2=0;
int loc11 =0;
int loc22=0;
double ran = Math.random();
if(ran <0.9) loc1 =" y.nextInt(8);" loc2 =" y.nextInt(8);" loc1 ="="" temp1=" ans[loc1];" temp2 =" ans[loc2];" temp3 =" temp1;" temp11=" ans[loc11];" temp22 =" ans[loc22];" temp33 =" temp11;" t =" 0;t
}
print.println("");
print.println(" fitness after mutation: "+addfit);
System.out.println(addfit+" ");
total+=addfit;
}
print.println(" " );
}
int ave;
ave=total/generation;
print.println(" Average "+ave );
}//close try
catch(FileNotFoundException fnf)
{
System.out.println("File Not Found");
System.out.println(fnf.getMessage());
}
catch(IOException io)
{
System.out.println(io.getMessage());
}
catch(Exception a)
{
}
print.close();
}//close main
}//close minipro
sometime it juz suckssss
juz go ahead. malas dah aku nak tanyer...nak keep on contect... lyn jer saper yg nak kwn ngn kiter... malas dah nak tehegeh2 mcm muke x tau malu.... penat la... dah penat. may be i have done something wrog be 4 this. so take this chances to ask for forgiveness from u all.
so moralnyer aku dapat kali ni... 'hurm don't know wht to say la'. juz ikut flow sudah la. malas nak nak buat bender sia2. juz waste time. pas 2 some more buat sakit ati.
cyber cafe (_prolog)
% dynamic variables
:-dynamic(pc_member/2).
:-dynamic(pc_list/4).
% list of people registered as member. pc_member(ID,Name)
pc_member(110,ali).
pc_member(112,abdul).
pc_member(115,salmah).
pc_member(111,farah).
pc_member(118,siti).
% list of pc (all). pc_list(PcNum,Username,Usertype,Starttime)
pc_list(1,null,null,0).
pc_list(2,ali,member,2007).
pc_list(3,farah,member,1100).
pc_list(4,null,null,0).
pc_list(5,aminah,nonmember,0900).
pc_list(6,null,null,0).
pc_list(7,null,null,0).
pc_list(8,samad,nonmember,1434).
%pc_ava(X):- pc_list(X,null,_,_).
pc_available(L):-
findall(X,pc_list(X,null,_,_),L).
all_pc(L):-
findall(X,pc_list(X,_,_,_),L).
% =========================PROGRAMME===============================
% the program
run:-
greetings.
% ========================MAIN MENU================================
% main menu
greetings:-
nl,nl,
write('+---------------------------+'),nl,
write('| Epc-shop cybercafe Center |'),nl,
write('+---------------------------+'),nl,nl,
write(' Main Menu '),nl,
write(' -----------'),nl,
write(' 1 . PC Menu '),nl,
write(' 2 . Member Menu '),nl,
write(' 3 . Payment Menu '),nl,
write(' 4 . Terminate Program '),nl,nl,
write('Enter your selection : '),
read(X),
mainmenu(X).
% =======================PC MENU==================================
% pc menu
mainmenu(1):-
nl,nl,
write(' PC Menu '),nl,
write(' -------'),nl,
write(' 1 . View list of all pc '),nl,
write(' 2 . Register to use '),nl,
write(' 3 . Back to Main menu '),nl,nl,
write('Enter your selection : '),
read(X),
pcmenu(X).
% pc listing all.
pcmenu(1):-
write('+------------------------------------------------------+'),nl,
write('| PC NO | Name | Type | Start at |'),nl,
write('+------------------------------------------------------+'),nl,
listing(pc_list),nl,
mainmenu(1).
% pc listing all.
pcmenu(2):-
write('Enter pc number : '),read(W),nl,
write('Enter Name : '),read(X),nl,
write('Enter User Type : '),read(Y),nl,
write('Enter Start time (24-hours format): '),read(Z),nl,
retract(pc_list(W,_,_,_)),
assert(pc_list(W,X,Y,Z)),
write('PC loaded! : '),nl,
mainmenu(1).
% =======================MEMBER MENU================================
% member menu
mainmenu(2):-
nl,nl,
write(' Member Menu '),nl,
write(' -----------'),nl,
write(' 1 . View list of registered members '),nl,
write(' 2 . Search existing member '),nl,
write(' 3 . New member registration '),nl,
write(' 4 . Back to Main menu '),nl,nl,
write('Enter your selection : '),
read(X),
membermenu(X).
% member listing.
membermenu(1):-
write('+----------------------------------------------+'),nl,
write('| ID | Name |'),nl,
write('+----------------------------------------------+'),nl,
listing(pc_member),nl,
mainmenu(2).
% searching existing member.
membermenu(2):-
nl,nl,
write(' Searching Menu '),nl,
write(' --------------'),nl,
write(' 1 . By ID '),nl,
write(' 2 . By Name '),nl,
write(' 3 . Back '),nl,nl,
write('Enter your selection : '),
read(X),
searchmenu(X).
% search existing member by ID.
searchmenu(1):-
write('Enter member''s ID : '),
read(Z),
searching(Z).
searching(Z):-
pc_member(X,Y),nl,
Z=:=X,
write('Member information are :'),
write('ID: '),write(X),nl,
write('Name: '),write(Y),nl,
membermenu(2).
searching(Z):-
pc_member(X,Y),
Z=\=X,
write('Member not exist! :'),
membermenu(2),!.
% search existing member by name.
searchmenu(2):-
write('Enter member''s Name: '),
read(M),
searching2(M).
searching2(M):-
pc_member(X,Y),nl,
M=:=Y,
write('Member information are : '),
write('ID: '),write(X),nl,
write('Name: '),write(Y),nl,
membermenu(2).
searching2(M):-
pc_member(X,Y),
Z=\=Y,
write('Member not exist! :'),
membermenu(2),!.
%register new member
membermenu(3):-
write('Enter your name : '),
read(X),nl,
write('Enter your secret id : '),
read(K),nl,
assert(pc_member(X,K)),
write('Successfully add!'),nl,
mainmenu(2).
% ======================PAYMENT MENU================================
% payment menu
mainmenu(3):-
nl,nl,
write('List of available pc: '),nl,
write('+------------------------------------------------------+'),nl,
write('| PC NO | Name | Type | Start at |'),nl,
write('+------------------------------------------------------+'),nl,
listing(pc_list),nl,nl,
write('Enter pc number : '),read(W),nl,
pc_list(A,B,C,D),
W =:= A,
write('pc number : '),write(A),nl,
write('Customer Name : '),write(B),nl,
memberstatus(C,D).
% if PC not in use
memberstatus(null,0):-
write('PC not being use!'),nl,
greetings,!.
% for member PC usage
memberstatus(member,D):-
write('Enter current time (24-hours format) : '),read(X),nl,
Time is X-D,
Time2 is D/60,
Time3 is (Time2*2*0.9),
write('Status : '),write('member'),nl,
write('Start using pc at : '),write(D),nl,
write('End using pc at : '),write(X),nl,
write('Total time using : '),write(Time2),write(' hour'),nl,
write('Total payment is : RM'),write(Time3),nl,
total(1,Time3).
total(1,Time3):-
write('RM: '),write(Time3),
greetings.
% for non member PC usage
memberstatus(nonmember,D):-
write('Enter current time (24-hours format) : '),read(X),nl,
Time is X-D,
Time2 is D/60,
Time3 is (Time2*2),
write('Status : '),write('nonmember'),nl,
write('Start using pc at : '),write(D),nl,
write('End using pc at : '),write(X),nl,
write('Total time using : '),write(Time2),write(' hour'),nl,
write('Total payment is : RM'),write(Time3),nl,
greetings.
% ====================ERROR HANDLING===============================
% back to previous menu
membermenu(4):- greetings,!.
pcmenu(3):- greetings,!.
searchmenu(3):- mainmenu(2),!.
% to exit the program
mainmenu(4):-
nl,write('Exiting program..thank you'),nl,!.
% invalid data input
mainmenu(X):-
nl,write('Invalid input.Reenter again: '),nl,
greetings,!.
membermenu(X):-
nl,write('Invalid input.Reenter again: '),nl,
mainmenu(2),!.
searchmenu(X):-
nl,write('Invalid input.Reenter again: '),nl,
membermenu(2),!.
pcmenu(X):-
nl,write('Invalid input.Reenter again: '),nl,
mainmenu(1),!.
Monday, January 12, 2009
Tired not to do anything....
Cyber-shot is a line of digital cameras made by Sony. The Cyber-shot range is well known for its proprietary InfoLithium battery pack, the trademark Carl Zeiss lenses and overall design. Also, all Cyber-shot cameras accept Sony's proprietary Memory StickMemory Stick PRO Duo flash memory. Some high-end models have also supported CompactFlash. All Cyber-shot models have a DSC prefix in their names, which is an acronym for "Digital Still Camera".