two problems i can see, rnum is an instance of class Random, it is not a method that returns an int that you can assign to int variable jackpot. Also in your loop when you generate each random number...
Type: Posts; User: tonya
two problems i can see, rnum is an instance of class Random, it is not a method that returns an int that you can assign to int variable jackpot. Also in your loop when you generate each random number...
This will allow you compare a string to a Week enum value, the string will need to be tested prior it's use, it will give an Illegal Argument Exception if the string is not exactly the same as one of...
The java code you have supplied looks a bit confusing with what it is trying to achieve. A simple way to learn to write code, of any type, is to write down what you are trying to achieve in pseudo...
I think your statement below may be causing a problem, it is assigning a 'Stringbuilder' object to a 'String' ... you also have other errors around the 'str2' statements further down in your code ...
I think your teacher is looking for pseudo code to describe your algorithm. You can find some examples of pseudo code here.
Try writing down your tasks on paper in the order you would do them,...
Did you mean to read two lines of your text file per while loop? you do a read.readLine() twice for each loop
while ((line = read.readLine()) != null) {
text += line;
String g =...
I can't see anything obvious, unfortunately your code is difficult to read, and so is your attached screen shot of the error. Could you please cut and paste your code and error message in a code...
# javac -classpath /usr/hdp/2.6.5.0-292/hive2/lib/*:/usr/hdp/2.6.5.0-292/hadoop/*:/usr/hdp/2.6.5.0-292/hadoop-mapreduce/* lowercaseudf.java
lowercaseudf.java:7: error: cannot find symbol
...
for example it doesn't come much easier than this to find every third iteration
for(int i = 1; i < 10; i++) {
if(i%3 == 0) {
System.out.println(i);
}
}
I think this is actually C# code, I found this explaining the ref keyword
https://stackoverflow.com/questions/1167342/are-ref-and-out-in-c-sharp-the-same-a-pointers-in-c
It ran okay for me, you may want to test out your two numbers closest to 10 case to with something like this
closeToTen(7, 13);
Your overloaded method has ambiguous calls in class B_float and class B_bool. For the bool call to work you need to pass a bool in (as per the below)
class B_bool
{
public static void...
"But there is one more thing that needs to be added and I dont know where to begin.
I now need to sort the employees into 2 arrays (2018, 2017)
Distinguish between Employee, Salesman, and Executive...
the problem is in your recursion, when it backs out sum is the old value, you need to change your recursive call to:
if(sum>9) {
sum = Add(sum);
}
you have used a capital i instead of a lower case l in the println method. This method name is short for print line, so it should read:
System.out.println();
You have entered your weight and height incorrectly (weight is pounds not inches..) plus your maths is wrong is should be:
BMI = 703 * w / (h * h) :rolleyes: