Stacey Johnson

Ranch Hand
+ Follow
since Jan 11, 2004
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 Stacey Johnson

I'm completely lost. I don't know what to do anymore. Do I need constructors in this code to get my end result or have I been led down the wrong path. I am sooo close to quitting my course because I just don't know what to do with this program anymore. I don't even know where to look to find answers to my questions and errors. Is there anyone out there to shed some light on this for me? I feel like I'm beating my head against the wall.
19 years ago
Hello,
Okay I've fixed the stupid error regarding the () but what does the following error mean?
java:62: cannot resolve symbol
symbol : method add (Rtnl)
location: class Rtnl
sum = sum.add(x1);
^

Stacey
19 years ago
Hi all!
Well I had to take a break for a bit but now I'm back and working on my rationals problem. I'm suppose to have an output like the following:
1/1 + 1/2 + 1/3 + ...+ 1/n
1/1 + 1/2 + 1/2^2 +...+ 1/2^n
I think I've got my constructor mostly cleaned up but I'm still getting a few errors that I"m not sure what to do. Below is my code then the errors:

Some of my errors are:

cannot resolve symbol
symbol : constructor Rtnl (int,int)
location: class Rtnl
Rtnl sum = new Rtnl(0,1);
^
java:61: cannot resolve symbol
symbol : constructor Rtnl (int,int)
location: class Rtnl
Rtnl x1 = new Rtnl(1,x);
^
java:62: cannot resolve symbol
symbol : method add (Rtnl)
location: class Rtnl
sum = sum.add(x1);
^

I'm sure you can see a theme of my errors, but I just don't know what to do. Can anyone help?
Stacey
19 years ago
Hi,
I've read the question and I'm also unclear on the whole FOO thing. What exaxtly is it? What people use in examples only or does it call something up or what. I've seen a few people use this but I have never seen it referred to in my text book so I have no idea.
19 years ago
My learning situation is a tough one, I'm taking this beginner Java course (through a university for credits towards my degree) via correspondence. If I would have know it was going to be this tough I would have definitly taken it in the classroom format. Plus I work full time so I'm a bit exhausted. My text book is "Introduction to Java Programming 4th ed. By Y. Daniel Liang.
So I hope that gives you a better idea of where I'm coming from.
I know the first part of my code works because I tried it before I did anything else. It's the second half that I'm adding on that is giving me the grief. But I must say, I do appreciate the help more than you know .
Stacey
19 years ago
Thanks for the help so far, I've worked some more on it but I just don't know if I'm placing things right. I'm kinda confused at times. I'm trying to separate things out where they should go but I know I'm wrong. I know the first part of my code alone works to display:
1/1 + 1/2 + 1/3 + ...+ 1/n
It's the second part that is messing things up.

Am I even on the write track. I've read the comments so far and this is what I can sort of get from it. How wrong am I?
Stacey
19 years ago
Thanks for giving me code, but that doesn't really help me figure anything out. Can anyone look at my code and tell me if I'm way off base or where I should go from here. I would really like to work with what I have and work the errors out. I want to learn what I'm doing.
Thanks
Stacey
19 years ago
I'm sorry by I still don't understand. Your sample looks nothing like what I'm doing so I don't even know if I'm doing anything right. I was told to make some parameters in my constructor, but I really don't know if I'm going about it right.
Stacey
19 years ago
Hi,
I'm still on my rational problem of writing a program to display:
1/1 + 1/2 + 1/3 + ...+ 1/n
1/1 + 1/2 + 1/2^2 +...+ 1/2^n
I'm trying to work on the whole constructor thing and I dont' really know if I"m getting anywhere. Can someone help me please and give me a hint of what I'm doing wrong. I'm not sure if I need to have "class Rtnl" in there. I'm a bit shady on the constructor concept as well.
I've posted my code below and then the errors.

The errors are as follows:

62: cannot resolve symbol
symbol : method add (Rtnl)
location: class Rtnl
sum = sum.add(x1);
^
74: cannot resolve symbol
symbol : constructor Rtnl (int,double)
location: class Rtnl
Rtnl y1 = new Rtnl (1,Math.pow(2,y));
^
:76: cannot resolve symbol
symbol : method add (Rtnl)
location: class Rtnl
sum = sum.add(y1);
^
operator != cannot be applied to Rtnl,int
if (y1 !=10)
^

Thanks in advance for the help.
Stacey
19 years ago
Thanks for the advise, I forgot about the no "." thing in the file name. Stupid error. So I now have that fixed but I am still getting two errors. My code is the same (accept it is now its public class Exercise 9_2) I don't understand the errors I'm getting because I have what they are asking for. I'll post the code below again and the errors, can someone help me, I'm just plain puzzled now:

The errors are:
java:53: '{' expected
public class Exercise 9_1{
^
java:88: '}' expected
^
I've put the tow line numbers in bold so you can easily find what line the errrors are refering too.
Thanks
Stacey
19 years ago
Hi there,
Yes Tim you are right this is an exercise, I have to admit I've been away for a bit and trying to get back into it. I find it very difficult. I've fixed up my code a bit but now I'm getting different errors. I didn't add the constructor as you will see but I'm only getting 3 errors now and I don't know why:

My errors are as follows:

Exercise 9.1.java:53: '{' expected
public class Exercise 9.1 {
^
Exercise 9.1.java:87: '}' expected
}
^
class Exercise is public, should be declared in a file named Exercise.java
public class Exercise 9.1 {
^

Just a little background on me, I'm taking this course via correspondence and working full time. I know better now than to try and do intro programming (that I've never done before) on my own. I'm feeling quite overwhelmed. But I have to say I've had lots of help from everyone on this site and lots of explanation and good leads which is what I need. I'm trying to get past this one program so I can move on and but I feel soo stuck.
Stacey
19 years ago
I'm soo confused I really don't know what to do. First of all I'm not even sure where to place the constructor. I"m soo lost.
Stacey
19 years ago
Hi everyone,
I'm working on my rational problem still of having my program output:
1/1 + 1/2 + 1/3 + ...+ 1/n
1/1 + 1/2 + 1/2^2 +...+ 1/2^n
Below is my code, I'm getting 7 errors and I don't get why. Can someone please explain?

Here are a couple of the errors to start:

cannot resolve symbol
symbol : constructor Rtnl (int,int)
location: class Rtnl
Rtnl sum = new Rtnl(0,1);
^
cannot resolve symbol
symbol : constructor Rtnl (int,double)
location: class Rtnl
Rtnl x1 = new Rtnl(1,x);
^


My brain hurts
Stacey
19 years ago
Hi,
Thanks for the help, but can I get a little further explaination on the second half of the code. Because it won't compile and run yet I can't see the printout and deduct things from there.
Also I am getting a bunch of errors all pertaining to every "Rtnl" every time it comes up. All of the errors say it cannot resove symbol. I don't know what do to?
Can anyone give me some insight please?
Thanks Stacey
19 years ago
HI everyone,
I'm still working on this rational program I have to write. I'm writing a program that will compute the following summation series using rational class:
1/1 + 1/2 + 1/3 + ...+ 1/n
1/1 + 1/2 + 1/2^2 +...+ 1/2^n
I think I have the first part worked out mostly but now it's the second part. I know I definetly am doing something wrong. I'm trying to get the ^3's to increase up to 10 then give the sum. I don't know if I've don't that right. Can someone please help me!! I'm confused!
Below is what I've written so far:

I thank all in advance for their help.
Stacey
19 years ago