The quieter you are, the more you are able to hear.
Kemal Sokolovic wrote:I'm not sure what you mean by "combining" here.
The only thing that comes to my mind is that you can define a separate class, say TextStatistics that would contain methods used in both applications (one method to calculate the number of words for the given String, another to calculate the average length and another for vowels). These would all be separate methods but would reside in the same class. The class constructor would have a String argument that would be text you are analyzing. Hence you can use this class to get all the information you need in both applications.
But still you would have two classes, each with main method - one for the GUI client and another for when your client enters text from the command line.
The quieter you are, the more you are able to hear.
Kemal Sokolovic wrote:Ok, let's try step by step now.
Is the assignment requirement to capture text from the user from both JTextArea (the first application) and command line (the second one)?
The quieter you are, the more you are able to hear.
Kemal Sokolovic wrote:That would be very bad design as it's not recommended to mix these two. Is there any way you can provide some more details about the assignment requirements besides that "combine these two applications"?
Jackson Lawton wrote:
Kemal Sokolovic wrote:That would be very bad design as it's not recommended to mix these two. Is there any way you can provide some more details about the assignment requirements besides that "combine these two applications"?
She just said to combine the 2 into 1 program (she not good at explaining things). So I guess whatever we get to work is fine as long as both are in 1 program.
The quieter you are, the more you are able to hear.
Jackson Lawton wrote:If you can figure a way to combine these 2 programs into 1 let me know
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:
Jackson Lawton wrote:If you can figure a way to combine these 2 programs into 1 let me know
so, you are asking us to figure out your homework for you? We don't really do that here. We are happy to help you, but you have to do the heavy lifting.
Can you go back to your teacher and ask her to clarify what exactly she means? Part of becoming a good programmer is knowing when you don't have enough info to do what someone is asking you to do. You have to keep going back, and ask them to clarify things until you both feel like you agree on what needs to be done.
The quieter you are, the more you are able to hear.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|