Answer to Question #243682 in Java | JSP | JSF for ssmi

Question #243682

 Create a class called Item that a hardware store might use to represent a list of items * that a client may need. * A Item should include the following information as instance variables: * a part description (type String), * a part type of item (type String), * a part price (type double), * a part year of production (type int), * a part capacity of the item (type String), * a part processing (type String) * Your class should have a constructor that initializes the instance variables. * Provide a set and a get method for each instance variable. 


1
Expert's answer
2021-09-28T11:42:48-0400
class Item {
	// part description (type String)
	private String partDescription;
	// a part type of item (type String)
	private String partType;
	// a part price (type double)
	private double partPrice;
	// a part year of production (type int)
	private int partYear;
	// a part capacity of the item (type String)
	private String partCapacity;
	// a part processing (type String)
	private String partProcessing;


	/**
	 * A constructor that initializes the instance variables.
	 * 
	 * @param partDescription
	 * @param partType
	 * @param partPrice
	 * @param partYear
	 * @param partCapacity
	 * @param partProcessing
	 */
	public Item(String partDescription, String partType, double partPrice, int partYear, String partCapacity,
			String partProcessing) {
		this.partDescription = partDescription;
		this.partType = partType;
		this.partPrice = partPrice;
		this.partYear = partYear;
		this.partCapacity = partCapacity;
		this.partProcessing = partProcessing;
	}


	// Provide a set and a get method for each instance variable.
	/**
	 * @return the partDescription
	 */
	public String getPartDescription() {
		return partDescription;
	}


	/**
	 * @param partDescription the partDescription to set
	 */
	public void setPartDescription(String partDescription) {
		this.partDescription = partDescription;
	}


	/**
	 * @return the partType
	 */
	public String getPartType() {
		return partType;
	}


	/**
	 * @param partType the partType to set
	 */
	public void setPartType(String partType) {
		this.partType = partType;
	}


	/**
	 * @return the partPrice
	 */
	public double getPartPrice() {
		return partPrice;
	}


	/**
	 * @param partPrice the partPrice to set
	 */
	public void setPartPrice(double partPrice) {
		this.partPrice = partPrice;
	}


	/**
	 * @return the partYear
	 */
	public int getPartYear() {
		return partYear;
	}


	/**
	 * @param partYear the partYear to set
	 */
	public void setPartYear(int partYear) {
		this.partYear = partYear;
	}


	/**
	 * @return the partCapacity
	 */
	public String getPartCapacity() {
		return partCapacity;
	}


	/**
	 * @param partCapacity the partCapacity to set
	 */
	public void setPartCapacity(String partCapacity) {
		this.partCapacity = partCapacity;
	}


}


public class Main {


	public static void main(String[] args) {
		
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS