Linnea Palin

Greenhorn
+ Follow
since Oct 02, 2003
Merit badge: grant badges
For More
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Linnea Palin

Thanks!
20 years ago

Originally posted by William Barnes:
Would it not make more sense to learn about the Java API which has already solved this problem?


Uhm, then what is Java API? And where can I find it?
20 years ago
Just for the fun of it i was thinking i'd make a _very_ simple "calendar"... notice _very_ simple
Now, for every "monthname" (january, february and so forth) as well as "daysname" (monday, tuesday.. etc) i dont wanna have to write a option for each one of them.
Is there any automatic thing that knows the order of the month and days so that it could be used in something like

or at least the part?
Thanks in advanced! /Linnea
20 years ago
ok, i changed into a single equalsign.. also changed some other things, so please tell if i messed up something else instead.

and error is

Why is that? I can't put a ; in the middle of the equal signs..
20 years ago
Another test I made:

gives only one error. One the line


If you respond, please make sure i understand what version of code you meant
20 years ago
I've posted a thread that bears the topic "Help - boolean" aswell. Please read it through if you haven't.
I'm doing an assignement for my programming lessons, so therefore, please do not give me the answers, but give me help to get there Fair enough?
Okay, this is how far I've come after playing around with codes..

The thing is the errors I get are these:

why won't it work, what's the thing i missed about booleans? or is there something wrong with the int's i've made?
Thank you in advance..
20 years ago
This took some reading, but thanks a lot for your answers and I'll test Herb's code and change and try some stuff with it..
Now I think I've got a good picture of what it's about: time for testing, changing, trying, testing, changing, trying and it all over again
Thanks again.
20 years ago
Okay, here's the deal. I searched FAQ and all other links i found but none contains anything about booleans, which my programming teacher told me to look into a bit..
Would anyone please tell me what a boolean is and what it's used for?
Thanks in advance..
/Linnea
20 years ago
Most recent code:

I think that part about the square root if i makes sence, but still, I've tried some different ways i thought could state SQRT(i), but none works..
So, how do you state the squareroot of something?
20 years ago
Ok, this is the latest version:
public class TestTask4
{
public static void main (String[] args)
{
int i;
int x;
for(i=100; i<200; i++);
for(x=2; x<i; x++);
{
if (i%x != 0)
System.out.println(+i+" is a prime number");
if (i%x == 0)
System.out.println(+i+" is not a prime number");
else
System.out.println(+i+" is not a prime number");
}
}
}

but the loop doesn't work. what's wrong. something must be wrong cause when it has gotten one output, then it will stop and not loop again...
20 years ago
TY both, I prolly had been sitting for days wondering what was wrong otherwize...
Anyways, I'm at home now, and I've changed somethings, and this is what I've got right now..
public class Task4
{
public static void main (String[] args)
{
int i;
for( i=200; i>=100; i--);
{
if (i%2==0)
System.out.println(+i);
else
System.out.print("");
}
}
}
now, the thingie is that in the line:
if (i%2==0)
i don't want ==. I wan't to state that if it does NOT equal 0, then ...
Is there anyway to state the oposite to equals?
As you all know, I'm fairly new to this, and I'm not english speaking so forgive me if i might mislead you sometimes
If I didn't say earlier, the point of this is to output any prime number between 100 and 200. I got this hint from my teacher;
"Any number which divides exactly in 8 is a factor if 8. The factors of 8 are 1, 2, 4 and 8. If a number(x) is a factor of another(y) then y % x = 0. A prime number has just two different factors, itself and 1."
20 years ago
I'm making a program to output any prime number between 100 and 200 for my programming lesson. Now, I'm stuck. It seams everything would be working fine except for one error.
In the end:
{
if (i/num = svar)
System.out.println(+svar);
else
System.out.print("");
}
it won't recognize the "/", saying that
Task4.java [12:1] unexpected type
required: variable
found : value
if (i/num = svar)
^
1 error
-Could anyone help me on this one?
20 years ago