#I want to implement this logic but hard stuck with no ideas
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
gic from both functions in a variable. However, the logic from the second function depends on the output of the first function. How can I store and use the combined logic from both functions in my Java GUI?
One approach you can take is to create a method that calls both functions and returns the combined logic. Inside this method, you can call the first function and store its result in a variable. Then, based on this result, you can call the second function and combine its logic with the first function's result.
Another approach is to refactor your code so that the second function takes the output of the first function as a parameter. This way, you can directly pass the result of the first function to the second function and get the combined logic as an output.
Additionally, you can consider using lambda expressions or functional interfaces to represent your logic as objects. This can make it easier to combine and manipulate multiple functions' logic within your Java GUI.
Overall, by carefully designing your methods and considering how they interact with each other, you should be able to store and use combined logic from multiple functions in your Java GUI effectively.
this is my current code
i might need tons of dumbing down for this
should i take two variables lowest1 and 2 as parameters and update them
if someone wants the formula : capitalCost - resaleValue of nth year + maintenanceCost till nth year is the formula
is my formula implementation over complicating stuff