Business Information Systems Assignment

Added on - 18 Sep 2019

  • 3

    Pages

  • 1669

    Words

  • 106

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 1 of 3 pages
BIS 335 Homework 6 – Fall 2016Please review the syllabus for more detailed information on grading of homework assignments. Forthis assignment you ARE required to validate input (that is, you MUST give user friendly errormessages when users enter unexpected data, like alpha characters for numbers, or a floating pointnumber instead of an integer, or a number out of range – example, the user entered 202 whenprompted for age – you would respond that this is not an appropriate input and ask for it again untilthe program met input requirements).Part 1: item classesIn this part of the homework you will create 6 class files that will be used by Part 2. These are classesthat will create objects that can be purchased online and put into a shopping cart – they will NOT havemain methods. Note that all instance variables should be private. Note that all methods should bepublic.Item.java:This abstract class defines an item for sale online. Each item has a 9 digit ID number, name,and price. The ID number could start with zeros or could include letters, so think carefully about its type.In this class you should also create a variable to track the total number of items created. This variable isa class variable (not an instance variable). Create a constructor that will create an item object andincrease the total number of items counter. This constructor will take input for each of the instancevariables to create the object. Also, for each of the instance variables, create a method that will get thevariable and another method that will set the variable. These are the “getter” and “setter” methodstalked about in lecture (see section 5.1.3 of your textbook). Then create a toString() method in this classto RETURN a user friendly description about the item (see section 5.3.2 of your textbook). Include anabstract method called tax() in this class that returns a double and takes no parametersBook.java:This class extends the Item class and defines a book. It adds ISBN (International StandardBook Number), author first name, author last name, type (Hardcover, Softcover, or Electronic, noted byH, S or E), and number of pages as instance variables.Create a constructor in this class that calls the parent constructor from Item.java (see section 5.6.2 ofyour textbook) and adds the instance variables particular to Book.java as well. Also, for each of the Bookinstance variables, create a method that will get the variable and another method that will set thevariable. Finally, create a toString() method that calls the parent toString() method from Item.java andadds in the particular instance variables for Book.java. The toString method should return book iteminformation in a user friendly way. Override the abstract method tax() which will return the sales tax onthis individual book object. Assume 6% sales tax.Clothing.java:This class extends the Item class and defines a clothing item. It adds brand, size, and coloras instance variables that are particular to the clothing class. Note that size could have values like“medium” and “6”.Create a constructor in this class that calls the parent constructor from Item.java (see section 5.6.2 ofyour textbook) and adds the instance variables particular to clothing.java as well. Also, for each of theinstance variables for clothing, create a method that will get the variable and another method that willset the variable. Finally, create a toString() method that calls the parent toString() method fromItem.java and adds in the particular instance variables for clothing.java. The toString method shouldreturn the clothing item information in a user friendly way. Override the abstract method tax() whichwill return the sales tax on this individual clothing object. Assume no tax on clothing.
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document