This is what my definition code looks like now using a constructor:
public class ProjectDefinition {
String userNameFirst;
String userNameLast;
String userPhone;
int userFilm;
int userPrints;
final int USER_EXPOSURES = 1;
public ProjectDefinition(String userNameFirst, String userNameLast,
String userPhone, int userFilm, int userPrints)
{
super();
this.userNameFirst = userNameFirst;
this.userNameLast = userNameLast;
this.userPhone = userPhone;
this.userFilm = userFilm;
this.userPrints = userPrints;
}
public String toString()
{
return "Welcome to Photo World"+ "\n\n" + "First Name:" + " " + userNameFirst + "\n" + " " +
"Last Name:" + " " + userNameLast + "\n" + " " +
"Phone Number:" + " " + userPhone + "\n" + " " +
"Rolls of Film:" + " " + userFilm + "\n" + " " +
"Number of Prints:" + " " + userPrints;
}
}
My problem is changing the controller code to work with it:
public class ProjectDefinition {
String userNameFirst;
String userNameLast;
String userPhone;
int userFilm;
int userPrints;
final int USER_EXPOSURES = 1;
public ProjectDefinition(String userNameFirst, String userNameLast,
String userPhone, int userFilm, int userPrints)
{
super();
this.userNameFirst = userNameFirst;
this.userNameLast = userNameLast;
this.userPhone = userPhone;
this.userFilm = userFilm;
this.userPrints = userPrints;
}
public String toString()
{
return "Welcome to Photo World"+ "\n\n" + "First Name:" + " " + userNameFirst + "\n" + " " +
"Last Name:" + " " + userNameLast + "\n" + " " +
"Phone Number:" + " " + userPhone + "\n" + " " +
"Rolls of Film:" + " " + userFilm + "\n" + " " +
"Number of Prints:" + " " + userPrints;
}
}