Forums Register Login

Grocery App Ideas

+Pie Number of slices to send: Send
Hello, I am new here and hopefully posting in the correct forum.

I have never programmed in an OO language before and am in the process of learning Java. I want to write a simple app to get a feel for the language. It will probably be a console app first (I haven't read up on writing a gui app yet). Basically, I want an app I can keep track of my grocery store purchases. For example, I would enter the date, store, item and price for each item I buy. I am having trouble thinking of how this would translate to Java objects. Here is what I have come up with.

A Store class that would simply contain the name of each store I shop at.
An Item class that contains each item I buy (maybe a category as well).
A Purchase class that contains a date of purchase, an item object, a store object and a purchase amount.

Should I split up each of the above classes in their own file, combine them all in one file??

After finishing my "Learning Java" book, I will probably look for a Design Patterns book, but I wanted to get a jump start on Java apps.


Thanks for reading.
David
+Pie Number of slices to send: Send
 

David Serio wrote:Should I split up each of the above classes in their own file, combine them all in one file??


You'd need to have them in separate files, assuming that each class should be publicly accessible.
+Pie Number of slices to send: Send
 

David Newton wrote:

David Serio wrote:Should I split up each of the above classes in their own file, combine them all in one file??


You'd need to have them in separate files, assuming that each class should be publicly accessible.



Thanks.
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1032 times.
Similar Threads
Search FIle System for Pattern Match
Performance of Java Object Referece
? in a Linked List
Read File
Linked List
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:07:19.