Mary plans a round-world trip in which he would like to visit a number of friends at each city she stops at. She sorts the cities according to the number of friends so she can visit P friends at Pth city of the trip, where k = 1, 2, ...., N, coincidently. Assume that it would take 1 day for Mary to visit one friend including the local travel time, and also 1 day for her to travel from one city to the next.

How should i write in simple java...

by typing the source code into an editor, how else?

We're NOT here to do your homework for you, and that's what your dumping your assignment here and expecting us to do it amounts to.

First work out how you would do it by hand. Write down what that process is. Then finally translate it into Java code.

by typing the source code into an editor, how else?

We're NOT here to do your homework for you, and that's what your dumping your assignment here and expecting us to do it amounts to.

I am new to java.... I not posting here to ask someone to do the homework for me... What are the step i should actually considered to do...

First work out how you would do it by hand. Write down what that process is. Then finally translate it into Java code.

Noted ur advice.. I have already work out in by hand.. I am new to java... Figuring out how should the Java code like...

I hope that this forum isn't lonely hearts :-)

Where exactly are you stuck? Can you do the "Hello World" program? If not, that's where you need to start. How about methods & loops?

Noted ur advice.. I have already work out in by hand.. I am new to java... Figuring out how should the Java code like...

if you've already designed it, and know some Java, just type it in.
If not, learn Java.

We're not here to do your homework for you. And so far you've done nothing except asking us to do just that, do your homework for you.

As you've seen, nobody's going to write your code for you, but we can probably walk you through the development process if you need it. What does your pseudocode look like?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.