The superclass (example DataStorage) Name Use a name in the singular form (example DataStorage, not DataStorages) Attributes (in addition to the attributes you chose): SKU (long): stock keeping unit number. Universal identifier: products with the same SKU are the same products. Price: floating-point number Name: text Desсrіption: text VAT: percentage Set appropriate accessibility Constructors Add a constructor with parameters for all attributes Add a constructor with parameters for all attributes except one and set a default value for that one. Take care not to duplicate code, rather reuse code. Methods Add appropriate getters and setters. Add methods that return the price and the price with VAT added. Add a toString method that returns all info as a user-friendly text. Add equals and hashcode methods. The subclasses (examples ExternalHardDrive, NetworkedAttachedStorage) Name Use a name in the singular form (Example ExternalHardDrive, not ExternalHardDrives) Attributes Add your specific attributes for each subclass. Constructors One subclass has a constructor with parameters for all attributes. The other subclass has: A constructor with parameters for all attributes except the default attribute used in the superclass. A constructor with parameters for all attributes except the default attribute used in the superclass AND except one of the subclass′s attributes (also receives a default value). Again, take care not to duplicate code. Methods Add appropriate getters and setters. toString, equals, and hashcode should work correctly. Reuse (superclass) code where possible. Custom Attribute class Remember that one of your classes′ attributes needs to be of a custom class you have defined yourself. For example, our ExternalHardDrive class has an attribute capacity of class Capacity. We have created the class Capacity ourselves with attributes amount (a number) and unit (″PB,″ ″TB″ or ″GB″). Your custom class has a constructor that has all attributes as parameters. The custom class has getters, but no setters. The custom class has equals, toString and hashcode methods. When you create an object of a product class, it also has parameters for each attribute of the custom class. Example: ExternalHardDrive(25665, ″Seagate 2TB hard drive″,66.11,″The best drive ever″, 21, 2, ″TB″) In this example, parameters are SKU, name, price, desсrіption, VAT, capacity amount, and capacity unit. The last two parameters are related to the Capacity class. Note: you will have some more parameters. Class SalesLine Attributes – the product that was sold (whose type is to one of the classes above) – the number of products that were sold Constructors Add a constructor that takes all attributes as parameters. Methods Add appropriate getters and setters and a toString method that presents SalesLine info in a user-friendly way. Add methods that show sales line price (quantity * product price): VAT inclusive VAT exclusive VAT only Add a method printInvoice that prints the SalesLine, as it would be printed on a professional invoice, on one line Product name. Example: Seagate 2TB hard drive Quantity. Example: 5 Unit price. Example €66.11 Price excluding VAT. Example €330.55 VAT. Example €69.40 Price including VAT. Example €399.95 Class Sale Attributes An array of a maximum of 100 SalesLines The current number of SalesLines in the array Customer name Constructor Parameters Customer name Methods A method to add a SalesLine Methods that show the total price of all SalesLines: VAT inclusive VAT exclusive VAT only A method toString that prints all information in the Sale (reusing code from the other classes) A method printInvoice that prints an invoice with A proper heading block with customer information A table with A header (PRODUCT – UNIT PRICE – QUANTITY – TOTAL – VAT – TOTAL INCL) Format the header as you like All SalesLines with the information in the columns aligning with the headers A summary block with grand totals for the invoice with total price excluding VAT, VAT amount, and the total price including VAT. The amount including VAT needs to be rounded to €0.05. Use appropriate spacing, ASCII lines (e.g. dashes) and layout to produce a professional-looking ASCII invoice. Class Runner Add a class Runner with a main method to the default package. In the main method: Create at least 9 products: at least three for each of the three classes you created (in contrast to Amazon, you also create products for the superclass). Call a method that asks the user for his/her name. Call a method that presents a menu to the user with a numbered list of available products. The menu should also contain an item with the number 0, indicating the customer has finished entering products. Ask the user to enter the number of the chosen menu item. If the number is not valid, print an error message and ask the number again. If the number is 0, end the method and return a Sale object with the items bought. Asks for the number of products bought. Attention, if there is already a SalesLine with this product, the quantity should be added to the existing SalesLine. Present the menu again Print the returned Sale object (toString). Print the invoice. The Runner class should be a maximum of 25 lines long. The methods you call from it should belong to another class, which you need to add to your project. Interface Taxable Declare an interface called Taxable with four methods: getVatPercentage: this method should return a number, which is the VAT (Links to an external site.) percentage. getTax: this method should return the actual Value-added tax for the product in question. getPriceIncludingVat: this method should return the product′s price, including VAT. getPriceExcludingVat: this method should return the product′s price, not including VAT. Update Superclass and Subclass Make sure that each of your products is taxable. Do this by using the interface Taxable. Take a close look at your superclass as well as your subclass (the ones that represent your chosen product). There should already be a couple of attributes and methods related to price and VAT. Now, refactor your code in such a way that your classes comply with the Taxable interface. For example, if you already have a method ′getVat′, rename it to ′getVatPercentage′ (see the interface′s first method above). Update Sale and SalesLine Renaming certain methods and aligning your products with the Taxable interface will cause some errors in other parts of your code, such as Sale and SalesLine. Make sure you fix these errors. Constants Make sure that all literals that appear in your code are replaced by constants (final class variables). Place each class variable in the most appropriate class. Remember not to misuse ″static″!

- Discuss Over under and through by Tana Hoban.
- Managing Xerox’s Multinational Development Center.
- Write a Spireslack field report.
- Discuss “Gates of Paradise” by Lorenzo Ghiberti.
- Describe Mechanical vibrations with viscous damping.
- Discuss Barbara Tyson Mosley.
- Discuss The problems in the global industrialised food system.
- Describe The Roman Colosseum.
- What did Orientalism do to the act of translation?
- Read and critique Hitchcock’s (2015b) paper.