Yani Abela

Greenhorn
+ Follow
since Jan 30, 2012
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yani Abela

hey thanks for your replies !! they helped a lot and I solved it thanks again!!
10 years ago
hi there
I am currently doing a DVD Rental System that when the user runs the program, he gets to choose from the menus. My problem is that when the user enters a menu and customizes for example a client, I don't know how to go back for the main menu. This is what I have done so far;

This is the main menu ;



Then the user chooses for example the number 1 (Clients) and the following menu is then shown:



I don't know what do I have to write in case 6 so that the main menu will be shown again. Can somebody please help?? Thanks
10 years ago
hi there
I am currently doing a DVD Rental System that when the user runs the program, he gets to choose from the menus. My problem is that when the user enters a menu and customizes for example a client, I don't know how to go back for the main menu. This is what I have done so far;

This is the main menu


Then the user chooses for example the number 1 (Clients) and the following menu is then shown:


now my problem is that I don't know what do I have to write in case 6 so that the main menu will be shown again. Can somebody please help?? Thanks
10 years ago

Henry Wong wrote:

can you elaborate, as I am not sure what you are asking?

Henry




I did a school project which was mainly a Dvd Rental System where I had the following classes ; Client class and SalesPerson class (both inherit from the class named Person), DVD class, DvdShop class, Runner Class & Loan Class. I used Bluej.

Now, I need this extension so that the Bluej itself gives me the UML diagram of each class. I know the extension is called Class Cards but I don't know where to get it from. I tried several sites but it won't install
I hope I expressed my self better now
Thanks
Hi there

I am trying to get the class cards extension to get the UML diagrams for my classes.
Do you know from where to get it please??

Thanks

Anayonkar Shivalkar wrote:Oops. I put wrong code
Here is the one:



BUT id has to initalised. Is it good if I do it --> int id = sc.nextInt;
thanks
10 years ago
thanks for your replies
I inserted the code you gave me. but why is the program reading an input twice?? What is happening is that the program prompts the user to enter the ID and i enter for example 6 and it does nothing until I insert another number!! why is that ??

Thanks
10 years ago
thanks for your replies

if my criteria is that the number entered has to be and integer and has to be a positive number, I just add the other criteria in the if loop??
I did this but the output is not correct!! when I enter a negative number the program does nothing at all!!
here is how I tried to do it;

System.out.println("Please enter ID");
int id = sc.nextInt();
if(sc.hasNextInt() || id >0)
{
newClient.SetId(sc.nextInt());
}
else
{
System.out.println("Invalid!");
}

what am i doing wrong now?? I am really confused!!
10 years ago
thanks for your reply to be honest I did not understand your reply very well. Can you please give me an example regarding my problem please?? Sorry for asking you again but I am really confused!!
10 years ago
umm... i don t know how to do that can you please give me an example?? thanks
10 years ago
Hi there Thanks very much for your reply it worked perfectly well for when entering a negative number.
But I still have another problem. I don't want the ID to be a decimal number. For example; if the user enters 5.5 as the ID number, the program gives an error that the input is invalid.
Hope this time I explained myself better! thanks again
10 years ago
hi there
I am doing a java project. It is mainly a DVD rental system. In the client class I have the get and set methods. Now, my problem is that when I am adding a client to the arraylist, the program asks the user to enter the ID of the client. I have set the ID as an integer. Now, I want the program to inform the user that an invalid input has been entered when a negative number or a decimal number is entered. Can you please help??
This is what I did s far;

This is in the Runner class ;

case 1:

//Adding a new Client

Client newClient = new Client();

//Ask user to input details of client being added

System.out.println("Please enter ID");
newClient.SetId(sc.nextInt());
System.out.println("Please enter name");
newClient.SetName(sc.next());
System.out.println("Please enter surname");
newClient.SetSurname(sc.next());
System.out.println("Please enter email");
newClient.SetEmail(sc.next());
System.out.println("Please enter address");
newClient.SetAddress(sc.next());
System.out.println("Please enter mobile no.");
newClient.SetMobile(sc.nextInt());


//Add to DvdShop
myDvdShop.addClient(newClient);

break;

I don't know how to continue can somebody please help?? thanks . (Code snippets are really appreciated )

10 years ago
thanks verymuch It helped a lot thanks again
10 years ago