im a 1st yr IT student, we have a final project this end of class. . . all we have to do is make a program using java. Honestly, java is very hard for me so if i can have a favor please help me to understand it more. . . Iam willing to have a tutorial on how to make a program... Our professor told us to make a phonebook. . .thank a lot who willing to help me . . . reply asap

You were completely and utterly incapable even of reading your courseware or listening to your teacher while he was teaching you yet expect us to give you private tutoring here in the form of a few messages?
And you were completely incapable of reading Sun's own website which lists some excellent tutorials yet expect us to provide you with some?

And you want us to drop whatever we're doing to help you out NOW!!!!!! ?

Seems you have very weird expectations, and are extremely rude as well.

Learn some manners, follow your classes and do your homework next time, use the internet, bookstores, and libraries to gather your own information instead of waiting for it to be handed to you in predigested chunks, and maybe you'll learn something.

im a 1st yr IT student, we have a final project this end of class. . . all we have to do is make a program using java. Honestly, java is very hard for me so if i can have a favor please help me to understand it more. . . Iam willing to have a tutorial on how to make a program... Our professor told us to make a phonebook. . .thank a lot who willing to help me . . . reply asap

Aside from the rant below, what exactly are the specifications of your assignment? Do you need to have a GUI, have a limit in what data structures you can use?

ahm sorry to disturb you but all i say is who is willing to help me . . . sorry my mistake. . .

ahm do you have an yahoo messenger??? what is GUI??? sorry but i have not enough knowledge about computer

ahm thanks . . . your right but i really really need a help a help with this matter Iam realy begging you

ahm thanks . . . your right but i really really need a help a help with this matter Iam realy begging you

Okay, calm down. List out: your program description, anything you are not allowed to use, specific trouble you might be having, in an orderly and logical fashion. Then maybe some help can be offered.

A GUI (Graphical User Interface) is basically what you see all the time. You click somewhere and an event is triggered and your program reacts. I don't think a first year IT student would be required to design a GUI.
You do need to be more specific. Here's some key aspects:

Do you need to be able to store the phone numbers?

Is it a console application or a GUI?

You'll obviously need to store your data internally. Using a class would be a good idea:

class Data
{
    String name, number;
}

It probably should be an internal class. Then in your outer class you'd have an array of Data:

Data ppl = new Data[n]

Where n is some max limit of entries. If there is no max then a Vector can be used as it grows without restriction.

You would be able to then add and implement a search algorithm and that's that :)

If you need to store, the class Data can be written to a file with ease.

All the best! Power to the people.

how can i start a program??? how can i use switch control structure... i'm thinking of a program but i can't convert because of my limited knowledge in java syntax...

ahm sorry i dont want to do this but this is maybe the last thing in my mind... our professor told us to create a program using java. this are the description. . .the program is like a phonebook containing of adding,deleting,editing,searching of users. . . I really really thank you a lot for helping me

do your own homework, lazy kiddo.
And if you're as incapable of doing that as you claim to be you deserve to fail.
Go to school and pay attention in class in the future and you might learn something instead of having to badger others into doing your homework for you.
What are you going to do when you get out of school, be a leech on society for the rest of your life? Sitting there lazing away on social security while others work their asses off to pay your government granted income? Or cheat your way into some job and let others do your work for you there while you suck up to management to prevent being fired for incompetence?

hi there zhapool
i can (and Enjoy) to help you but you really Told us Your problem Really Unclearly ,
if you have a messenger (yahoo messenger ) i can help you to do it ,
Be lucky

ahm sorry i dont want to do this but this is maybe the last thing in my mind... our professor told us to create a program using java. this are the description. . .the program is like a phonebook containing of adding,deleting,editing,searching of users. . . I really really thank you a lot for helping me

Look, I don't know how to be any clearer in this, if you want help you need to be clearer. Honestly, no one can help if you're going to be so vague.

zhapool is my yahoo messenger id... ahm our porject is creating a program using java... making a phonebook. example is like this
ouput prorgram:
Menu:
[1]add
[2]delete
[3]search
[4]sort
[5]edit
[6]exit

how can i explain it oir proram is a phonebook. output is should be like this
Menu
[1]add
[2]edit
[3]delete
[4]search
[5]sort

It's seem's like a Console application which is good since you wouldn't need to understand inheritance and other Java concepts. It seems like a pretty simple program, here's how the switch works:

switch (ORDINAL_VALUE)
{
  case VAL1 : //do processing
  break;
  case VAL2 : //do processing
  break;
  default : //do processing
}

The ORDINAL_VALUE refers to a variable or constant that is discreet (integer, boolean, char). Variables like float or String will not work. The brackets around the ORDINAL_VALUE is part of Java syntax, similar to the if statement.

The case keyword is followed by the specific value you're comparing with:

case 'A' : System.out.println("Letter A");

Obviously the constant value after the keyword case, should be the same type as the data you pass to the switch statement. Note single quotes for char, and no quotes for integers.

Each case is usually followed by a break. This simply tells java to exit the switch statement. Should you omit the break keyword, once a particular case is entered, java will proceed to all case's below it until a break is met or the switch statement is over.

The default keyword is used to specify what should be done if none of the case's match. For example if the user chooses an invalid option in you Menu, you should display an error message.

A switch statement does not repeat itself. Mdz seems like he will be of more help. I'm with Mac, you need to tell us specifically what you can't do in you program...

Peace.

how can i convert number into string ??? for example a user input a number like 500 and the output should be five hundred

If your program doesn't require input validation then you can simply input your data as a number. The Scanner class from java.util (you would have to import it to use it) will allow you to do this:

Scanner stdIn = new Scanner(System.in);
int a = stdIn.nextInt();

When you pass the

in

of the

System

class to the Scanner constructor, the object

stdIn

now will be able to read in data via the keyboard.

Also, note that since you are using Scanner and we are trying to read an integer from the keyboard, and exception might be thrown (IOException) so you would have to either use a try catch or declare you main method as:

public static void main(String[]args) throws IOException

You would have to import the

IOException

class form the java.io package.

If you do need to test user input (and so prevent your program from terminating on string input) you would use:

int a = Integer.parseInt(input)

Where

input

is a

String

variable. Also, the class

Integer

is automatically made available to you.

hi there zhapool
i can (and Enjoy) to help you but you really Told us Your problem Really Unclearly ,
if you have a messenger (yahoo messenger ) i can help you to do it ,
Be lucky

how can i convert an integer into string... for example if the input is 100 the output should be one hundred

how can i convert an integer into string... for example if the input is 100 the output should be one hundred

Are you sure you cannot simply print out the number to the string? It is a phonebook, it would be irritating to have to read five-five-five-six-zero-three-four, instead of 555-6034.

read the documentation, again it's all there.
If you had listened to earlier advise you'd have read the documentation already...

Gosh, I misunderstood the previous post. My bad! Though I've never come across a method in the documentation that converts from numbers to words. May I ask which class or package does this? Perhaps java.text?

the application that we are using is j2sdk. our professor told us that we should convert intger into string .

our real project is a phonebook but our professor give us an alternate project that is converting a number into word. . . example
Sample program
Enter number: 10
Output: ten

our real project is a phonebook but our professor give us an alternate project that is converting a number into word. . . example
Sample program
Enter number: 10
Output: ten

Well maybe we should keep to one program at a time.

A GUI (Graphical User Interface) is basically what you see all the time. You click somewhere and an event is triggered and your program reacts. I don't think a first year IT student would be required to design a GUI.
You do need to be more specific. Here's some key aspects:

Do you need to be able to store the phone numbers?

Is it a console application or a GUI?

You'll obviously need to store your data internally. Using a class would be a good idea:

class Data
{
    String name, number;
}

It probably should be an internal class. Then in your outer class you'd have an array of Data:

Data ppl = new Data[n]

Where n is some max limit of entries. If there is no max then a Vector can be used as it grows without restriction.

You would be able to then add and implement a search algorithm and that's that :)

If you need to store, the class Data can be written to a file with ease.

All the best! Power to the people.

need help too, but i dont know where to post my question..sori:(

This article has been dead for over six months. Start a new discussion instead.