This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Errors in GUI program

 
Candie Duggan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program for class that has 6 parts to it. I got all of them working except the GUI part. I keep getting two errors that repeat in the code. Could someone please explain what these errors mean and how can I fix them? Here is my code:


The errors on lines 247, 289, and 480 are: setMusicCD(int, MusicCD) in MusicCDInventory can not be applied to (int,CD)
The errors on lines473 and 499 are: incompatible types found : MusicCD location CD return new MusicCD(cDName, struPCNumber, genre, units, unitPrice);

Thank you in advance for any help you can give me.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a mighty long method.

247/etc. is a class cast problem: I'd guess (and w/o the rest it's just a guess) that the MusicCDInventory is expecting only MusicCD parameters, whereas you're trying to pass it a CD.
 
Candie Duggan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,
Thank you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic