Main objective is to implement a class that will be used as bag which will be capable of storing the values for different items and the prices in a specific class.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
CLOTHING BOUTIQUE BAG IMPLEMENTATION IN JAVA 1 Assignment Student Course Instructor Date
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
CLOTHING BOUTIQUE BAG IMPLEMENTATION IN JAVA 2 Introduction Main objective is to implement a class that will be used as bag which will be capable of storing the values for different items and the prices in a specific class. For the Bag data type order of insertion of the objects/elements is not irrelevant. The stored objects/elements can be stored as well as removed in a random manner (Lafore, 2017).Through the use of the Bag abstract data type, the most important intent is to use it and suggest collection of the objects which are familiar to developers or users in their day to day experience. Program 1 Pre-Planning (Clothing Boutique) The available operations for the proposed application of bag includes insertion of new values, removal of the elements, checking for an element in order to see if that value is stored in the collection of elements or bag. Furthermore it is also possible to find out the number of elements/objects in bag. In addition to that as there are problems which requires capability of looping over all the elements in the bag/container. This can be achieved in Bag data structure without exposing details of the implementation or knowing the way collection is organized in the memory. Furthermore bag is also helpful in constructing a set in java. Most of the functionalities are same in set with the only change in the addition of the element where it checks if the new element / value is already present in the collection or not. Operations like intersection of sets, set union as well as difference among them can be implemented through the use of the simple loop mechanisms available in java.
CLOTHING BOUTIQUE BAG IMPLEMENTATION IN JAVA 3 In order to implement the bag for the program the inbuilt getter and setter function is used. Along with that the scanner class is also used in order to get the user input for storing values of different variables (Joyce & Weems, 2016).The variables in the class are declared as private members in order to hide the data and methods to hide the complex logic of the programs and unintended changes to the values stored in the variables. In this way, it is possible to have increased and better control over the class attributes as well as methods. Through this the declared class variables are made as read-only or write-only through the selection of the only get () or set () method. The program becomes flexible. The program can be meant to develop in such a way that the user input can change one part of the application code while having no impact on other parts by enhancing the security of data. Conclusion In the complete implementation of the program theScanner class is also utilized in order to get the user input and store the value in the variables. This class is available inside the java.util package (Joyce & Weems, 2016). In order to use Scanner class, an object is created and the previously declare getter setter methods are utilized for assigning values to the variables. In the developed program the next () for the item_name and the nextInt() method for the price of the items. Screenshot of the program
CLOTHING BOUTIQUE BAG IMPLEMENTATION IN JAVA 4 References Horstmann, C. S. (2016).Big Java, Binder Ready Version: Early Objects. John Wiley & Sons. Joyce, D. T., & Weems, C. (2016).Object-oriented data structures using Java. Jones & Bartlett Publishers. Lafore, R. (2017).Data structures and algorithms in Java. Sams publishing. Savitch, W. (2017).Java: An Introduction to Problem Solving and Programming, Student Value Edition Plus MyProgrammingLab with Pearson eText-Access Card Package. Pearson.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser