• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inventory Program final help.  RSS feed

 
Rande Fisher
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The goal was to add a few buttons an add delete modify search and save. I feel like I have the entire need satisfied. I'm having a few symbol problems which I'm not quite sure how to fix.

My full code is:


I have 7 errors and 4 of them happen here:

Its pointing at all of them except for MobileOS

two errors here:


it points at the ( . ) at phone.setProdname and phone.setUnitprice

The last error is at:


which is directing me towards Prodname on the far right of the if statement. I'm not sure what the problem is. I've double checked my spellings several time for each spot and I cant quite get it.

Everyone has told me but I am aware that I made some bad decisions with the variables being capitalized this was my first go at a program and my instructor didn't let me know that thats the normal way to do it. Anyways, any help that can be gotten with this would be greatly appreciated. I will answer any and all questions that may arrise.
 
Rande Fisher
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DOH okay some of those errors I have fixed. I opened my eyes a bit more and found the misspellings. I have 2 errors now.



I get cannot find symbol at phone.setProdname and phone.setUnitprice both pointing at the periods.

 
Rande Fisher
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed it. But i am appreciative of all this forum has helped me with through my assignments. You guys are fantastic.
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rande Fisher wrote:I fixed it. But i am appreciative of all this forum has helped me with through my assignments. You guys are fantastic.

It will be really useful if you can post your fix here. The issue might be that your MobilePhone class didn't have setProdname and setUnitprice methods
 
Jude Niroshan
Ranch Hand
Posts: 132
5
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fisher,
I arranged your code in neat way. I have commented on the places where you made some mistakes. Hope this might helpful.










I didn't make any changes to GUI. I'm not expert in GUI. Honestly i hate to post this much of code as an answer.
i am appreciative of all this forum has helped me with through my assignments. You guys are fantastic.


Yes. Indeed. But don't just come here only when you want to complete an assignment. Be here as an active member. Help each other.... That's what i feel real awesome thing.
Regards,
Jude
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from the fact that its invocations make the lines too long, why are you using option panes? You appear to have a GUI; why not use text fields to enter all those details?
 
Rande Fisher
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:
Rande Fisher wrote:I fixed it. But i am appreciative of all this forum has helped me with through my assignments. You guys are fantastic.

It will be really useful if you can post your fix here. The issue might be that your MobilePhone class didn't have setProdname and setUnitprice methods


The was exactly what my problem was. I had forgotten to put some setters in my MobilePhone class. I can post my full code when I get home to show the changes that have been put through.

Now as for why I used option panes, I don't have any particular reason, that was what I learned in my researching so that was what I had used.

Also my apologies on the long code, I rather submit my assignments in a single file for school rather than submit 5 or so for the same project.

And on the final note. I do intend to help others who have been in my situation, but I'm sure with my several missing symbol cry for helps, that you're aware I am still a noob. When I branch out more and become more capable of a coder then I can offer my help, but I suppose for simple stuff like those for which I've asked help I can help with.

Again thank all of you for the help.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rande Fisher wrote: . . .
Also my apologies on the long code, I rather submit my assignments in a single file for school rather than submit 5 or so for the same project.
. . . .
Apology accepted

Please explain more about 5 files, and I shall explain why that should lose you marks.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few minutes ago, I wrote: . . . and I shall explain . . .
But I might be too busy for a quick reply.
 
Rande Fisher
Ranch Hand
Posts: 33
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lol. The 5 file thing is laziness. However I have a feeling that the ability to be read is easier when splitting them up to dedicated files. But even still I got the max grade on the assignment which is what I was primarily focused on.
 
Jude Niroshan
Ranch Hand
Posts: 132
5
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Laziness maybe, but the fewer files you submit the fewer classes you can create. As a general rule of thumb the fewer classes the less scope you have for designing classes and the less good the design will be.
 
Rande Fisher
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well these things are good to know. Every time I post I learn something new. All the advice people have given me will get utilized. I intend to expand my java knowledge on my own time by creating my own projects starting with a bill divider and calculator in which a person can input the number of people to split between and the calculator will determine how much each person pays. With this being my own time I will use every bit of advice I've been given. If there's anything else about my code that you believe could be better feel free to let me know. I know I need to rework the variable and class names to classes being caps and variables not starting with caps and now separating class files.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Laziness maybe, but the fewer files you submit the fewer classes you can create. As a general rule of thumb the fewer classes the less scope you have for designing classes and the less good the design will be.

I'm not sure I completely understand this. Are you talking about using interfaces and abstract classes?
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are only allowed one public class in a file, 5 files means you are only allowed 5 public classes. And 1 file means only one public class. So there is a risk of your writing a god class.

Of course I might have misunderstood the question completely and I might be barking up the wrong tree.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't add new questions to somebody else's thread. I shall create a new thread for you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!