Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the MS-Access database create a table Item with fields ItemId ItemName UnitPrice$ 1 Shampoo 20 2 Tooth Paste 4.50 3 Shirt 8.99 4 Rice

In the MS-Access database create a table Item with fields ItemId ItemName UnitPrice$ 1 Shampoo 20 2 Tooth Paste 4.50 3 Shirt 8.99 4 Rice 10.15 5 Bread 3.75 Create an Interface named Item which represents an item purchased at a departmental store. An item has associated with it an item id (the unique stock number for this item), an item name (a string name for the item), a quantity (the number of units of the item) and a unit price (the price of each unit of the item.) The implementations of this interface should use their constructors to set the initial values of these attributes. The interface should contain following abstract methods to 1 Get Item Id : Returns the stock number for this item. 2 Get Item Name: Returns the (non-unique) string name of this item. 3 Get Unit Price: Returns the price of this item. 4 Get TotalPrice: Returns the price of this item. This is simply the product of the (unit price) * (number of units) with applicable taxes added. So, TotalPrice For Ontario: unitPrice*quantity+(unitPrice*quantity*GST)+(unitPrice*quantity*PST) For Alberta: (unitPrice*quantity)+(unitPrice*quantity*GST) 5 Display using toString(): Returns this item in string form suitable for displaying In Ontario, the taxes to be added to items include the provincial sales tax (PST) of 8%, together with the federal sales tax (GST) of 7%. In Alberta, there is no provincial sales tax, so prices include only the GST. Provide two implementations of the Item interface, one for Ontario (named Ontario.java) and one for Alberta (named Alberta.java). Create a class BillMain, with main method asking user to Press 1 to insert a new Item,------ 2 to generate Bill for Ontario,----- 3 to generate bill for Alberta Store For Choice 1: Insert item in MS Access Item table as given below: ItemName: Chocolate UnitPrice: 3 For choice 2 and 3: Enter number of items to be billed. For each item enter the name to extract unit price of the item from database table Item. Enter quantity of the item purchased. Find out total price for an item depending on Alberta (GST) or Ontario(GST and PST). Calculate total bill thus generated.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

Students also viewed these Databases questions

Question

3. What are the main benefits of using more information technology?

Answered: 1 week ago