Win a copy of Spring Boot in Practice this week in the Spring forum!

Ayukawa Madoka

+ Follow
since Feb 28, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ayukawa Madoka

Didn't know Linpus is a chinese Linux (thought it was a newer version of Linux). Anyway, boot order in BIOS has been set to CD-ROM. Able to boot and install windows.

[ May 14, 2006: Message edited by: Ayukawa Madoka ]
16 years ago
Sorry if i posted this on the wrong section.

I just bought a notebook today and it happen that it is a Linpus Linux base system and has no OS installed into it yet. So how do i install Windows XP Professional on it? I'm not familiar with the commands as i had no knowledge on Linux.(only know how to install windows from dos) >.<;;

Edit: And also how do i partition the drive? Thanks in advance.
[ May 07, 2006: Message edited by: Ayukawa Madoka ]
16 years ago

Originally posted by David Powers:

I agree. I have the same book and I love it. I like that it breaks the programs down line-by-line and explains what those lines are doing. Also, there's plenty of exercises/programs.

Which edition are you using? Does it cover Circular-LinkedList and Doubly-LinkedList? Methods Overidding?

Today i went to the Kinokuniya bookstore just 15 minutes walk away from my college.. i wanted to get a Java reference book that covered most of the syllabus that my lecturer taught us so i browsed through almost every one of it but most of them are packed with plastic sheet.. dang! however i could only remember a few which are Java In A Nutshell, Thinking In Java, Complete Guide to Java... most of them are from the publisher Prentice Hall and Addison Wesley. Btw.. do you guys know why some of the Java books aren't selling in the United States and Canada? It's written there Internatinal Edition.. what does that mean?
17 years ago

Originally posted by salvador rc:
hi Ayukawa Madoka , your code is not working. r u sure ?
i copied and pasted, it is giving me compilation error.
of course the error is quite reasonable bcoz a java source code can not have two or more public classes ( your code has two public class ).
however, your example is good to suport the mechanism of static block operation.

First error was a typo, sorry. it's "String" and not "Sting".
Second error...
cut and paste the "Test" class on a new template and save it as

compile and execute it. it should work now.
18 years ago

Shall this be a ringbuffer - like the clock, where it starts from the beginning after reaching the end: '..., 10, 11, 12, 1, 2, ...'?

Yes that's right, the next reference of the list's last node references the first node, instead of null.

Is the size of this circular list known in advance, or shall it be possible to in- and decrease it's size?
Now, I'm talking about index, so you might be thinking ... array? If your circular list is of fixed size, an arry would be a fine implementation.

since the question does not mention whether they want it to be fixed or expandable, so to make it a good program lets implement it as a reference-base list (expandable) . any suggestions?
18 years ago
take a look at this...

The output is:
Static code i = 5
Main code i = 6
18 years ago
first of all, how do implement a circular linked list?
18 years ago
i had no idea how to do this, can anyone help me?
1) Declare a class CircularList which contains the proper data structure which support the implementation of the circular linked list. Each node in the linked list contain only integer element. [3 marks]
2) Implement the method showDetail, which serves the purpose of displaying all the data above circular linked list. [5 marks]
3) Add to your class another method passMark, that takes an integer pass parameter. The method should return the number of nodes with values above the pass value. [5 marks]
18 years ago
i'm writing a program that accepts an integer value from a user and determine whether it's an even or odd number and then displays the integer taken from the user onto the screen. the program was able to compile and execute but the weird thing is the display result wasn't correct. is there anything wrong with my program? or the method that i used to differentiate between even and odd number is wrong? :roll:

18 years ago
a) Define a class MyMath. Include a doubled-typed constant called PI that has a value of 3.14. Ensure that this member can be accessed without instantiating an object. [3 marks]
b) Include a method in the MyMath class called square that takes in an integer argument and returns the square of the argument. Ensure that this method can be called without instantiating an object. [2 marks]
c) Include another method called divide that takes in two integer parameters and divides the first number by the second number and returns the quotient. Note: You may not use the / and the % operators. Again, ensure that this method can be called without instantiating an object. [6 marks]
My question is...
1)how to ensure that the member can be accessed wihtout instantiating an object?
2)how do i suppose to divide the two value without using the / and % operator?
18 years ago
sorry i did a mistake, yes it was nOS/12 and nOS%12 instead of dozens/12 and leftOver/12
please forgive my carelessness.
mistake corrected. program able to compile and execute.
i have another problem. now, instead of assigning the numberOfSweets to value 30, i used the to allow the user to input whatever figure they want. the program was able to compile and execute but the problem is the output was inaccurate. let say the user input the value of 30, then the output for dozens is 4 and the output for leftOver is 3 instead of dozens=6 and leftOver=2. why do this happen? is there anything wrong with my program? please help me!
18 years ago
okay i completed the program...

To reduce the number of lines in this program, instead of...

I did...

I already declared the variables but it won't work. When compile it says

(same goes to leftOver)

[ March 16, 2004: Message edited by: ayukawa madoka ]
[ March 16, 2004: Message edited by: ayukawa madoka ]
[ March 16, 2004: Message edited by: ayukawa madoka ]
[ March 16, 2004: Message edited by: ayukawa madoka ]
18 years ago
Sorry for double posting. Anyway here is where i am stuck for Question 1...

/* Program name:
* Author name: Place your name here
* Description:
public class Sweets {
public static void main(String[] args) throws IOException {
int sweets;
System.out.println("Enter number of sweets: ");
sweets =;

public int numberOfSweets() {
dozens = sweets / 12;
System.out.print("You have "+ dozens +" dozens!");

[ March 15, 2004: Message edited by: ayukawa madoka ]
18 years ago
i have tried the following questions in my reference book but i just couldnt figure out how to do it. my reference book doesn't include the answers, so i need help from you guys to tell me the answer. if possible please explain every steps thanks!
Question 1. Create a class named Sweets. Its main() method holds an integer variable named numberOfSweets to which you will assign a value. Create a method to which you pass numberOfSweets. The method displays the sweets in dozens. For example, 40 sweets is 3 dozens and 4 left over.
Question 2. Create a class named Shirt with data fields for collar size and sleeve length. Include a constructor that takes arguments for each field. Also Include a String class variable named material and initialize it to "cotton". Write a program TestShirt to instantiate 3 Shirt objects with different collar sizes and sleeve lengths, and then display all the data, including material, for each shirt.
18 years ago