Question

In: Computer Science

write a program in java that contain a class for botique . data member include code...

write a program in java that contain a class for botique . data member include code , color , size , quantity . your class should contains all accessor and mutator methods , non paraqmetric constructor , parametric constructor , input andvidsplay method

Solutions

Expert Solution

solution:

CODE:

public class Botique {
   private String code;
   private String color;
   private int size;
   private int quantity;
   public Botique() {
       // TODO Auto-generated constructor stub
       System.out.println("non prametrized contructor");
   }
  

   public Botique(String code, String color, int size, int quantity) {
       this();
      
       this.code = code;
       this.color = color;
       this.size = size;
       this.quantity = quantity;
   }


   public String getCode() {
       return code;
   }


   public void setCode(String code) {
       this.code = code;
   }


   public String getColor() {
       return color;
   }


   public void setColor(String color) {
       this.color = color;
   }


   public int getSize() {
       return size;
   }


   public void setSize(int size) {
       this.size = size;
   }


   public int getQuantity() {
       return quantity;
   }


   public void setQuantity(int quantity) {
       this.quantity = quantity;
   }

   @Override
   public String toString() {
       return "Botique [code=" + code + ", color=" + color + ", size=" + size + ", quantity=" + quantity
               + ", getCode()=" + getCode() + ", getColor()=" + getColor() + ", getSize()=" + getSize()
               + ", getQuantity()=" + getQuantity() + ", getClass()=" + getClass()
               + "]";
   }

   public static void main(String[] args) {
       // TODO Auto-generated method stub
       Botique obj=new Botique();
       obj.setCode("ABC");
       obj.setColor("RED");
       obj.setSize(6);
       obj.setQuantity(10);
       System.out.println(obj.toString());
   }

}

OUTPUT:


please give me thumb up


Related Solutions

Write Java code for extending the LinkedList<E> class of java.util.* to ExtLinkedList<E> that would include the...
Write Java code for extending the LinkedList<E> class of java.util.* to ExtLinkedList<E> that would include the following method: public ExtLinkedList <E> mergeThreeLists (ExtLinkedList<E> list1, ExtLinkedList<E> list2) { } that returns an ExtLinkedList<E> which is the merged version of values from thislist, followed by values from list1, and then followed by values from list2.    For example, if E is Integer type and this listhas (5,3,1), list1has (8, 10,12,14), and list2has (22,23,24,25,26) in that order, then the returned list from a call to...
1.Write Java code for extending the LinkedList<E> class of java.util.* to ExtLinkedList<E> that would include the...
1.Write Java code for extending the LinkedList<E> class of java.util.* to ExtLinkedList<E> that would include the following method: public ExtLinkedList <E> mergeThreeLists (ExtLinkedList<E> list1, ExtLinkedList<E> list2) { } that returns an ExtLinkedList<E> which is the merged version of values from this list, followed by values from list1, and then followed by values from list2. For example, if E is Integer type and this list has (5,3,1), list1 has (8, 10,12,14), and list2 has (22,23,24,25,26) in that order, then the returned...
Java Write a Payroll class as demonstrated in the following UML diagram. Member variables of the...
Java Write a Payroll class as demonstrated in the following UML diagram. Member variables of the class are: NUM_EMPLOYEES: a constant integer variable to hold the number of employees. employeeId. An array of integers to hold employee identification numbers. hours. An array of integers to hold the number of hours worked by each employee payRate. An array of doubles to hold each employee’s hourly pay rate wages. An array of seven doubles to hold each employee’s gross wages The class...
JAVA CODE PLEASE write a casino membership application. in the casino membership class: data: membership ID...
JAVA CODE PLEASE write a casino membership application. in the casino membership class: data: membership ID points method: add points display points Main: create a membership object (a client) give initial points (600) increase the points by (try both 200 and 500)
Write a java program that has a class named Octagon that extends the class Circ and...
Write a java program that has a class named Octagon that extends the class Circ and implements Comparable (compare the object's area) and Cloneable interfaces. Assume that all the 8 sides of the octagon are of equal size. Your class Octagon, therefore, must represent an octagon inscribed into a circle of a given radius (inherited from Circle) and not introduce any new class variables. Provide constructors for clas Octagon with no parameters and with 1 parameter radius. Create a method...
Please write the code JAVA Write a program that allows the user to enter the last...
Please write the code JAVA Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate. The program should then output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election. A sample output is: Candidate      Votes Received                                % of Total Votes...
write a java code Write a generic program to compute the sum of 30 terms of...
write a java code Write a generic program to compute the sum of 30 terms of the following series. (181 - 5)/31 + (186 + 9)/34 - (191 - 13)/37 + (196 + 17)/40 + . . . . . 1 5 11 Note: the 3rd, 6th, 9th term etc, has a negative sign in front of parenthesis. User Input: None Expected output: Term Ratio Sum 1 5.677 5.677 2 5.735 11.413 3 -4.811 6.602
URGENT!! DO THIS CODE IN JAVA Write a complete Java FX program that displays a text...
URGENT!! DO THIS CODE IN JAVA Write a complete Java FX program that displays a text label and a button.When the program begins, the label displays a 0. Then each time the button is clicked, the number increases its value by 1; that is each time the user clicks the button the label displays 1,2,3,4............and so on.
Java Write a program to record the GPAs of a class and find the percentage of...
Java Write a program to record the GPAs of a class and find the percentage of students in each GPA. The program first allows the user to enter the number of students enrolled in the class, and then to enter the GPA of all students one by one. For each student, the input must be between 1 and 4 inclusively. Otherwise, the software displays a message as “Invalid number!” and asks for a new GPA for the same student Enter...
Write a java code for LinkedStack implementation and the code is: public final class LinkedStack<T> implements...
Write a java code for LinkedStack implementation and the code is: public final class LinkedStack<T> implements StackInterface<T> {    private Node topNode; // References the first node in the chain       public LinkedStack()    {        topNode = null;    } // end default constructor       public void push(T newEntry)    { topNode = new Node(newEntry, topNode); //       Node newNode = new Node(newEntry, topNode); //       topNode = newNode;    } // end push    public...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT