As I mentioned above, the constructor for CdwArtist is different. You have defined a constructor with the artist name parameter, so you must construct the object with that information. See comments I have added in your code below:
// begin display method
System.out.print("Enter up to 99 CD Names or STOP to Exit: ");
String nameInput = input.nextLine(); //read cd name
maxlength ++;
for(int i = 1; i < cds.length && !nameInput.equalsIgnoreCase("STOP"); i++)
{// begin main While
[B]cds[i] = new CdwArtist(); // This class does not have an empty constructor like this anymore. You changed it.[/B]
cds[i].setName(nameInput);
System.out.print("Enter CD Artist Name: "); // prompt for artist name
CdwArtist artist = new CdwArtist(input.nextLine()); [B]// here you create with the correct constructor, but you don't use the object anywhere else.[/B]
System.out.print("Enter Price of this CD: "); // prompt for price
cds[i].setPrice(input.nextFloat()); // price input from user.
while (cds[i].getPrice()<= 0)
{// begin while
System.out.print("Price Must Be Greater Than Zero. Enter Price: ");
cds[i].setPrice(input.nextFloat()); // cd price loop from user.
} // End while
I would recommend going back to your original class definition:
import java.util.*;
public class CdwArtist extends Compactdisk
{
private String artist; // artist performing on cd
// Artist constructor
public CdwAartist()
{
artist = "";
}
// set value
public void setCdArtist(String cdArtist)
{
artist = cdArtist;
}
// return value
public String getCdArtist()
{
return (artist);
}
} //End Class
Then your code is simply this
... <snipped top part>...
// begin display method
System.out.print("Enter up to 99 CD Names or STOP to Exit: ");
String nameInput = input.nextLine(); //read cd name
maxlength ++;
for(int i = 1; i < cds.length && !nameInput.equalsIgnoreCase("STOP"); i++)
{// begin main While
[B]cds[i] = new CdwArtist(); [/B]
cds[i].setName(nameInput);
System.out.print("Enter CD Artist Name: "); // prompt for artist name
[B]cds[i].setCdArtist(input.nextLine());[/B]
System.out.print("Enter Price of this CD: "); // prompt for price
cds[i].setPrice(input.nextFloat()); // price input from user.
while (cds[i].getPrice()<= 0)
{// begin while
System.out.print("Price Must Be Greater Than Zero. Enter Price: ");
cds[i].setPrice(input.nextFloat()); // cd price loop from user.
} // End while