Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Charith Jayasinghe

Greenhorn
+ Follow
since Jul 17, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Charith Jayasinghe

I did not do any mock exams unless 16 questions from the test exam provided with K&B 1.4 book, just a day before the exam. I scored 80%. Anyway mock exams are very much helpful to get familiar with questions and to have a confidence. If you are really struggling with time, K&B book and its questions are more and enough.
----------------------------------------------------
//Using Strings <too simple to ask this question>

public String numberFormatter(String Amt)
{
while (Amt.length()!=11)
{
Amt = "#"+Amt;
}
return Amt;
}

------------------------------------------------------

//Using a char[]

public String numberFormatter(String Amt)
{
char [] ca = new char[Amt.length()];
Amt.getChars(0, Amt.length(), ca, 0);
char[] fa = new char[11];
int y=ca.length-1;
for(int x=11; x>fa.length-ca.length; x--)
{
fa[x-1]=ca[y];
y-- ;
}

for(int x=0; x<fa.length;x++)
{
if(fa[x]=='\u0000')
fa[x]='#';
}
return new String(fa);
}
--------------------
15 years ago
----------------------------------------------------
//Using Strings <too simple to ask this question>

public String numberFormatter(String Amt)
{
while (Amt.length()!=11)
{
Amt = "#"+Amt;
}
return Amt;
}

------------------------------------------------------

//Using a char[]

public String numberFormatter(String Amt)
{
char [] ca = new char[Amt.length()];
Amt.getChars(0, Amt.length(), ca, 0);
char[] fa = new char[11];
int y=ca.length-1;
for(int x=11; x>fa.length-ca.length; x--)
{
fa[x-1]=ca[y];
y--;
}

for(int x=0; x<fa.length;x++)
{
if(fa[x]=='\u0000')
fa[x]='#';
}
return new String(fa);
}
15 years ago
Thanks for the guidance!
15 years ago
Ya i have made a mistake by saying an int variable. Anyway again the question is this :

When people printing amounts in bills and cheques, they use a standard format to avoid frauds. For an example amount will always display in a fixed number of didgits, assume its 10 digits for a while. So, if the amount to be printed is $ 4501.00, then it should be printed as $ ###4501.00

There will be fixed number of digits. And does anybody has a good algorythm to convert numbers in to words ?
15 years ago
Mistakenly i have mentioned it as DECIMAL. Sorry abt that.

I am trying to solve my matter with the help of URL given. I'll update the progress.

THANKS!
15 years ago
I have an int variable, which may contain a decimal value. I need to convert it to a standarc format. For an example, say my value is 148.05, the code should format it as ####148.05

if the value is 4589.00, then the outcome must be ###4589.00

the length of the var is constant. Can any one give me a logic please.
15 years ago
I need this to be done in a form printing code.

I have an int variable, which may contain a decimal value. I need to convert it to a standarc format. For an example, say my value is 148.05, the code should format it as ####148.05

if the value is 4589.00, then the outcome must be ###4589.00

the length of the var is constant. Can any one give me a logic please.
15 years ago
I also bought this book targeting the exam, Some expert in SL recomended this book. Buddy, u seems to be in SL. Why cant we share something. mail me to charith@charith.net
I am totally new to Servlets and JSP. I bought Head First servlets and JSP book with a mind of learning stuff and take the exam SCWCD. I noticed that i need to install TOMCAT to work with these topics.

But I'm working on a Microsoft platform where i have win XP, IIS and .NET framework. If i put TOMCAT on this same machine, will there be any conflicts ? Can i use IIS for servlet manipulation instead of TOMCAT? :roll:

Your kind advices are greatly appreciated.
I'm also having the same issue. Can anybody render a help please.
i completed SCJP 1.4 last July. I am expecting to do SCECD. Bur which is the best thing to go ahead with, SCJP 5 or SCWCD ? Thanks for the advices in advance.
Read my Blog
Me tooo waiting from this end of the world, till K&B put their book in to market.
Here is Sri Lanka you can go for Kathy and Beer Bates book. Its the Best for 1.4, as i have heared there are no resources yet solely for the 1.5, what u can do is, get the K&B's 1.4 book. Study them to end, then findout what are the differances in 1.5 ( new stuff added to 1.5) cover them up using some other material. U can buy K&B book for Rs.900 with the CD from Expographics.

Follow the above if u r taking the exam soon. Otherwise u can wait till a resource is release.

Cheeeeeeeeeeeeers! on the exam.

Charith.NET