Omo Jesu

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

Recent posts by Omo Jesu

Jim Pouwels wrote:

Omo Jesu wrote:

John Jai wrote:What is the issue you are facing. You have to create an inner map like below. What is the logic you are trying to achieve?




Hi,

Thanks very much for the inner map concept. But I have two classes with a class variable each as a string just to name it as title. I want the map to be able to map an integer value... like the amount in stock to a game in a particular store. Remember that there is a game class and a store class. How will I be able to create instances of a game and store in the HashMap also call/query the object variables.. like the what is the integer for this game in this store...

Thanks



I think reading the (Hash)Map API will certainly answer your question!



I have done that but I am no just getting it.
9 years ago

John Jai wrote:What is the issue you are facing. You have to create an inner map like below. What is the logic you are trying to achieve?




Hi,

Thanks very much for the inner map concept. But I have two classes with a class variable each as a string just to name it as title. I want the map to be able to map an integer value... like the amount in stock to a game in a particular store. Remember that there is a game class and a store class. How will I be able to create instances of a game and store in the HashMap also call/query the object variables.. like the what is the integer for this game in this store...

Thanks
9 years ago
I have a code I am working on but having issues populating the HashMap of HashMaps.. The declaration goes as thus;



Where Game and Store are seperate object classes with only a class variable title.

How do I create instances of the objects in the HashMaps and also populate the two hashmaps because I need to tag an Integer to the game in a particular store... whereas there are different stores and different games in each store.

Thanks in Advance
9 years ago
I have two classes already created one for product and the other for stores. that is where m stuck.
9 years ago
It is a fresh algorithm that I am looking for a way to write. I know i have to use classes to hold the games - titles, copies and status. Also then use Map<Integer, Map<String, Object>> to hold the values... But I need help on the way forward... maybe a skeleton will do and I will fill in the blanks.
9 years ago
It is a fresh algorithm that I am looking for a way to write. I know i have to use classes to hold the games - titles, copies and status. Also then use Map<Integer, Map<String, Object>> to hold the values... But I need help on the way forward... maybe a skeleton will do and I will fill in the blanks.
9 years ago
Hello All,

I have a coursework and all I have tried have proved abortive except knowing what I am to use is just HashMaps....

Consider development of software for administration of a chain of ve local game stores. Each store
has some number of games for rent. For each title, each store may have zero or more copies of games.
Each copy will always have the status for either rented, in stock, or overdue.
Design data structures and algorithms necessary to support the following queries and activities:
1. At which stores is a copy of a game in stock?
2. How many copies are checked out versus in stock?
3. Check out a rental game to a customer and update the stock records.
4. Check in a returned game and update the appropriate stock records.
5. Print a list of games that are overdue.
9 years ago
Hello,

I am to write an algorithm to tackle some actions on a chain of local game stores.
The types of action would include something like;

At which stores is a product in stock?
How many products are checked out versus in stock?
Check out a product to a customer and update the stock records.
Check in a returned product and update the appropriate stock records.
Printing a list of products that are out-of-stock.

The question is that can this be done and the algorithm/code run without writing out the whole code for the five stores and if I am to write the full code, which I think is the only way to achieve this, How can that be done so as to take different record for the whole five local stores and then take the actions on them.

Please all answers will be highly appreciated.

And also, what kind of data structures might be used... LinkedList? Stacks? Queues?
9 years ago

Jason Hardaway wrote:Before JDK 5, you had to call the getContentPane() method in order to get a reference to the content pane and after that, you had to call the add() method on that reference to add the component. Now, beginning with JDK 5 and forward, it is not necessary to make an explicit call to getContentPane() because a call to add() is already routed to the content pane when add() is called on a top-level container such as JFrame. Hope this helps you.



Thanks... but was confused when Head First Java said we must add to ContentPane and the book covers Java 5.0
10 years ago

Darryl Burke wrote:Read the API for JFrame or JDialog. It's well explained there.

To get a better understanding of the role of the contentPane etc go through the API for RootPaneContainer.



Thanks very much... Checking the RootPaneContainer API out now!

10 years ago
Hello All,

Saw a code in a recent textbook saying everything must be added to the contentPane before being added to the Panel. But in another recent book, I was made to know that it is not compulsory that you can easily just use the add to the frame and it gets loaded to the contentPane automatically, which I have tried and it worked. Is there any difference in both? Please explain.
10 years ago
Hi Forum,

Please I need help on how to implement multidimensional vectors. I alerady have a working program that does everything using arrays and multidimensional arrays. Now I need to store the input and output information needed in a file. At the beginning of the program, they need to be stored in a vector and at the end from the vectors, they need to be stored back into the file.

How am I to implement the multidimensional vector. Ideas will be highly appreciated.

Regards
10 years ago

Wouter Oet wrote:What do you mean with an external file?

If it is just a file on your file-system then this should work:

Read the file into memory
Do some editing
Write to the file.

If you don't know how to read/write from/to a file see the oracle tutorial.



Thanks Wouter for the response... but I am confused about writing arrays and reading arrays from a local file (I mean file stored on the local system) because it consists of something like this;

Names [Omo Jesu]
No of Subjects [3]
The Subjects[15, 52, 55]
Final Mark[32]


Something like that and they are all of different data types and also the subjects also also changes... like some might be of length 5 and some of length 6 and might also need to work on the length if i need to calculate the average.

Rgds
10 years ago
Hello,

I have a working program that normally, I hand-wire the information into the file and it is stored in an array and I work with it till the end of the program. This is where the problem is coming from.

Now the document will be in an external file, and the informations needed for the program should be read from the external file;

At the beginning of the program, the input file will be loaded into the program and the file will be saved at the end of the program. Giving room for editing / adding to the file during program run and at the end save all the information back into same external file.

Please how am I to go about this? I really need help in here....

Thanks for your help in advance.

Regards
10 years ago