Ask a question to Desklib · AI bot

Ask NowBETA

Business Information Systems Assignment

Added on -2019-09-18

| 3 pages
| 1669 words
| 208 views

Trusted by 2+ million users,
1000+ happy students everyday

BIS 335 Homework 6 – Fall 2016Please review the syllabus for more detailed information on grading of homework assignments. For this assignment you ARE required to validate input (that is, you MUST give user friendly error messages when users enter unexpected data, like alpha characters for numbers, or a floating point number instead of an integer, or a number out of range – example, the user entered 202 when prompted for age – you would respond that this is not an appropriate input and ask for it again until the 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 classes that will create objects that can be purchased online and put into a shopping cart – they will NOT have main methods. Note that all instance variables should be private. Note that all methods should be public.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 is a class variable (not an instance variable). Create a constructor that will create an item object and increase the total number of items counter. This constructor will take input for each of the instance variables to create the object. Also, for each of the instance variables, create a method that will get the variable and another method that will set the variable. These are the “getter” and “setter” methods talked about in lecture (see section 5.1.3 of your textbook). Then create a toString() method in this class to RETURN a user friendly description about the item (see section 5.3.2 of your textbook). Include an abstract 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 Standard Book Number), author first name, author last name, type (Hardcover, Softcover, or Electronic, noted by H, 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 of your 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 the variable. Finally, create a toString() method that calls the parent toString() method from Item.java and adds in the particular instance variables for Book.java. The toString method should return book item information in a user friendly way. Override the abstract method tax() which will return the sales tax on this 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 color as 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 of your textbook) and adds the instance variables particular to clothing.java as well. Also, for each of the instance variables for clothing, create a method that will get the variable and another method that will set the variable. Finally, create a toString() method that calls the parent toString() method from Item.java and adds in the particular instance variables for clothing.java. The toString method should return the clothing item information in a user friendly way. Override the abstract method tax() which will return the sales tax on this individual clothing object. Assume no tax on clothing.

Found this document preview useful?

You are reading a preview
Upload your documents to download
or
Become a Desklib member to get accesss

Students who viewed this