Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!

Daniel Chivelly

Greenhorn
+ Follow
since Nov 12, 2019
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
1
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Daniel Chivelly

Eduardo Rod wrote:

Piet Souris wrote:Your push method requires an Entry as argument, but you have a double.

And, when you pop, you do not adjust the size variable.



Yes, the method as you defined receives an object of type Entry, and then you are pushing a float instead of an object would this works?:




Thank you so much how did I not get that? stress and fixations haha thank you!
1 week ago

Campbell Ritchie wrote:Afraid you have fallen into a common pitfall. Your pop() method doesn't delete the top element; that is a potential memory leak. Since you are using a List, you can probably write return myList.remove(...); and get rid of the memory leak.
I would augment the stack class with an isEmpty() method.



Could you explain how so? I have written the following test which passed the pop method before I made changes to the push method.

1 week ago

Carey Brown wrote:Line 31 is a closing paren, not a brace.



I might have accidentally added that whilst copying in the code, I was more questioning why my push(Entry i) method doesnt accept integers when testing the method.
1 week ago
Hello, I am trying to make a couple classes of a calculator for my college project. I have to make a stack class, entry class and have two enums TYPE and SYMBOL inherited to entry class. I have only included relevant code but essentially, my push method doesnt like the argument push(Entry i) and i cant work out why. i have a junit5 test for it that i'll also include, and the error i get is "The method push(Entry) in the type CalcStack is not applicable for the arguments (int)". If anyone can help i'd be over the moon! I've also included the UML if that helps

1 week ago

 
This programme is supposed to find the longest straight-line distance between two points.


     @param points an array of points, each represented as a length-2 array of x and y coord.

     @return the longest straight-line distance between any two points in an array of points in points

7 months ago
Hello,

I have to create a method:



It should read values from the input line alternately into xVal and yVal until a negative value is read or until greater than 2∗maxPoints
are read. which returns an int numPoints.
output needs to be shown in the format:


Having trouble figuring out how to read into ALTERNATE arrays. Thank you
10 months ago


       My code below is supposed to read text from a file and store it into a string,
       then count the frequency of each letter and store it into an array counters. When
       compiling i receive the arrayindexoutofbounds error for line 42 of my code which is the
       line: scanner2.close() .
   
     
 

   Also confused on what the \\A string pattern does on the use.delimiter() as a partner helped
   with this and forgot to add comments. thank you
11 months ago