Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~2K People Reached
Favorite Forums
Favorite Tags
c++ x 20
java x 13
Member Avatar for hao90

[CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class SwingAnimation{ Thread th; ImageIcon images; JFrame frame; JLabel lbl; int i = 0; int j; public static void main(String[] args){ SwingAnimation sa = new SwingAnimation(); } public SwingAnimation(){ frame = new JFrame("Animation Frame"); th = new Thread(); lbl = new JLabel(); Panel …

Member Avatar for JamesCherrill
0
120
Member Avatar for hao90

How to let the button set to it "latest" text because i suppose to set the button's text to "booked" and the foreground to red. However, everytime i re-run the program, the button re-set. I know i should do something on constructor, but how? Here is my coding.. Thanks for …

Member Avatar for JKP()
0
92
Member Avatar for hao90

I suppose to write the records to a text file. However every time i re-log in and add a record.The previous record will be rewrite. >.<'' [CODE]public void addRecords(){ getInfo(); FileWriter fWriter = null; BufferedWriter writer = null; try { fWriter = new FileWriter("PassengerInfo.txt"); writer = new BufferedWriter(fWriter); writer.write(name); writer.write(";"); …

Member Avatar for hao90
0
177
Member Avatar for hao90

i[CODE]mport javax.swing.*; public class ReverseArray { public static void reverse(int b[]){ int left = 0; int right = b.length -1; while(left<right){ //exchange the left and right elements int temp = b[left]; b[left] = b[right]; b[right] = temp; left++; right--; } } public static void main(String a[]){ } } [/CODE] how …

Member Avatar for hao90
0
109
Member Avatar for hao90

[CODE]public class Human { private String name; public Human(String name){ this.name = name; } public String getName(){ return name; } public String toString(){ return "Human " + getName(); } } interface Electrician{ public String changeBulb(); } interface Plumber{ public String unplugDrain(); } class HandyPerson extends Human implements Electrician, Plumber{ public …

Member Avatar for hao90
0
111
Member Avatar for hao90

Can anyone teach me how to assign a empty array to zero? Which means that some of the c[x][y] have not assigned to a value. [CODE]int x = 4; int y = 4; a[x] = {30,40,50,60}; b[y] = {100,20,60,40}; c[x][y]; int i = 0; int j = 0; while(i<x && …

Member Avatar for hao90
0
101
Member Avatar for hao90

sorry that i don't know i post on a correct place or not..=D my question is: How can i use the adjacency matrix like A B A 0 1 B 1 0 and write it to form of adjacency list like A -> B B -> A Hope you all …

Member Avatar for hao90
0
94
Member Avatar for hao90

I am learning the OOP recently and i have a few questions to ask 1) When should i use operator overloading? 2) When should i use template?

Member Avatar for jbennet
0
102
Member Avatar for hao90

i think this part got problem..anyone can guide me? [CODE]ifstream BanKing; BanKing.open("BankData.txt"); while (!BanKing.eof()) { BanKing>>loginName; BanKing>>password; if(loginName == loginName1 && password == password1) { menu(); break; } else { cout<<"\tUnregistered ID or you have enter a wrong password !"<<endl; cin.clear(); cin.ignore(); getchar(); return ; } BanKing.close(); } }[/CODE] i …

Member Avatar for hao90
0
169
Member Avatar for hao90

Can anyone guide me how to solve for the login problem..i think is the read file problem.. I try many ways but can't. here the code: [CODE]#include <iostream> #include <string> #include <fstream> #include <cstdlib> #include <cmath> #include <windows.h> using namespace std; class bankAccount { private: string name, loginName,loginName1; float IDnum; …

Member Avatar for hao90
0
256
Member Avatar for hao90

[CODE]#include <iostream> #include <cstring> using namespace std; int numberOfDeposit, numberOfWithdrawal; double monthlyInterestRate, monthlyInterest; float totalAmount; double MonthlyServiceCharge; int selections, choices, functions; string name, address, loginID; int idNum, password; class bankAccount { public: bankAccount() { float balance; double annualInterestRate; } float thismonthDeposit; float thismonthwithdrawal; float balance; float getbalance() { return balance; …

Member Avatar for zobadof
0
182