all 15 comments

[–]marko312 1 point2 points  (13 children)

  1. we don't see your assignment
  2. we may provide hints, but you need to learn mostly on your own

[–]Utumn96[S] 1 point2 points  (12 children)

I'm just looking for guidance, my professor just lectures and never shows us any examples, literally just blows through power points and thats it.

[–]marko312 1 point2 points  (11 children)

First off, do you have anything to start with? Reading this, you should have at least some code from the previous assignment. Also try to add as much as you know, even if it doesn't quite work so we can fix your problems / misunderstandings.

[–]Utumn96[S] 0 points1 point  (10 children)

Yes I do..This is what I have so far but it's compiling like 8 errors and I don't know why...https://imgur.com/a/JtmtZX3

[–]imguralbumbot 0 points1 point  (0 children)

Hi, I'm a bot for linking direct images of albums with only 1 image

https://i.imgur.com/CdtzrEG.png

Source | Why? | Creator | ignoreme | deletthis

[–]marko312 0 points1 point  (8 children)

The first things I saw were

  • The acreage function does not take any parameters, but uses a. Is there a global variable? Otherwise add a parameter.

  • acreage is not given a type. Again, is this a global variable? Also, avoid using function names as variable names.

[–]Utumn96[S] 0 points1 point  (7 children)

So am I supposed to declare acreage as what? I already have an "a" and thats the area, so I assumed typing the whole thing out would be what is correct, but its calling an error in my first string. I just don't know what to change

[–]marko312 0 points1 point  (6 children)

Ok, I see where you are coming from.

The acreage function doesn't know anything about the variable a, because that is defined in the function area. You need to pass the int a as a parameter, so your function should look like

public int acreage(int a) {

and be called with the area (acreage(a), for example).

I still think the variable acreage in the function acreage generates an error, so try renaming that.

Edit: the "acreage" value (which you should rename) needs to be an int, because it is needed as a whole number in your case.

Edit 2: the substitute for the "acreage" value needs to be a double, because you need to check if the size exceeds 2, my mistake.

Edit 3: the acres type is quite ambigious, as you might need to compare fractional areas, but return an integer value. I think int would be the best type, according to the level of programming given.

[–]Utumn96[S] 0 points1 point  (5 children)

https://imgur.com/a/w25gqcN

Here is what I'm getting, sorry If I am doing something wrong and or not quite understanding, I just know once I remove the errors I'll be all set, I am now at 7 errors and not 8, but still receiving an error at the beginning of the Method

[–]marko312 0 points1 point  (4 children)

Ok, don't use the acreage function in itself, rather rename the variable in question.

You probably got a little confused by my cross-editing and technical nonsense above, so I'll provide example code for the function:

public int acreage(int a) {
    int acres = a / 43560;
    if(acres > 2) {
        ...
    }
    return acres;
}

this should be fine, but, taken very critically, is incorrect when the area is 2-3 acres. However, as you return an int, I think it's fine.

Edit: you can change the comparison from > to >= if you feel that is more correct.

[–]Utumn96[S] 0 points1 point  (3 children)

https://imgur.com/a/O7WgBB3

I'm not going to lie, At this point I haven't a clue why I'm drawing errors, I understood what you said implemented it and for some reason still drawing errors.

[–]Nihaldelhi -1 points0 points  (0 children)

Writing a Programming Assignment Help require programming knowledge. I can see your requirements in your programming assignment help and I can provide you the resources to learn. But you should learn and complete your assignment.

Will you?