954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help!!! Help!!! Help!!!

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

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

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.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
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?

MacGyver Orca
Light Poster
39 posts since Jan 2007
Reputation Points: 19
Solved Threads: 4
 

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

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

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

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

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

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 
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 anorderly and logical fashion. Then maybe some help can be offered.

MacGyver Orca
Light Poster
39 posts since Jan 2007
Reputation Points: 19
Solved Threads: 4
 

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.

PoovenM
Junior Poster
151 posts since Aug 2006
Reputation Points: 56
Solved Threads: 11
 

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...

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

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

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

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?

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

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

mzd12111
Light Poster
48 posts since Nov 2006
Reputation Points: 7
Solved Threads: 0
Infraction Points: 5
 
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 tobe clearer. Honestly, no one can help if you're going to be so vague.

MacGyver Orca
Light Poster
39 posts since Jan 2007
Reputation Points: 19
Solved Threads: 4
 

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

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

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

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

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.

PoovenM
Junior Poster
151 posts since Aug 2006
Reputation Points: 56
Solved Threads: 11
 

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

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

read the documentation, it's all there.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

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.

PoovenM
Junior Poster
151 posts since Aug 2006
Reputation Points: 56
Solved Threads: 11
 
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

zhapool
Newbie Poster
13 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You