Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assessment task focuses on the following Learning Outcomes: * Effectively use object - oriented design and understand appropriate methodology. * Comprehend the fundamental data

This assessment task focuses on the following Learning Outcomes:
* Effectively use object-oriented design and understand appropriate methodology.
* Comprehend the fundamental data structures and their computational process
* Create Graphic User Interfaces (GUI) by employing appropriate libraries and interfaces
* Design, develop and test object-oriented programs according to language principles
Write Java code to develop an App.
The system which you are about to build is to represent a variety of product types available at a supermarket. They will all have a common method to produce multiple lines of output suitable to be included in a docket. However, depending on what type of product it is, this output will contain different sorts of information.
For all product items, the output (for a docket) should include the following. Feel free to make the format you like.
The ID of product item
The name of the product item
The type of the product item
The price of the item
The amount of the price which is a tax-component (explained next)
Depending on the type of product, the following additional information should be output:
If it is a Fresh Fruit item, the weight of the item (e.g., the Apple is 200 grams, the watermelon is 1250 grams).
If it is a Packaged item, the quantity of units in the package (e.g.,6 eggs in the package, 24 chocolate bars in the bag), and a use-by date.
The tax-component is calculated from the price of the item, and the following rates are used:
For Fresh Fruit items, 0%
For Packaged items, 10% of the price Detailed Tasks
1. Create a class named Product to be the superclass of all products. It should have suitable constructors to aid with polymorphic behaviour and contain suitable attributes to store the information that is common to all product types (but whose values vary for each instance of that product type), and appropriate accessors. The class also contains a generic toString() method. Briefly explain this class in your recorded video.
2. Create a class to represent Fresh Fruit items. It should be a subclass of the class Product. Ensure that it contains appropriate attributes to store additional information specific to fresh fruit. Ensure that there is a suitable constructor, and mutators to set all values appropriately and that there are appropriate accessors to obtain all information relevant to fresh fruit. Override toString() method so that it returns all relevant information related to the fresh fruit. Briefly explain some features of this class in your recorded video.
3. Create a class to represent Packaged items. It should be a subclass of the class made in task 1. Ensure that it contains appropriate attributes to store additional information specific to packaged items. Ensure that there is a suitable constructor, and mutators to set all values appropriately and that there are appropriate accessors to obtain all information relevant to packaged items. Override toString() method so that it returns all relevant information related to the Packaged items. Briefly explain some features of this class in your recorded video.
4. Draw a UML class diagram for the above-mentioned product classes. Show all attributes, methods, and proper relationships between classes. Include the diagram and its description in the readme file. Also, include the program output screenshots in the readme file with brief descriptions.
5. Create a driver class that will have a main method and the following functionalities. Explain the key functions and implementations you reckon in your recorded video.
Create at least 5 Fresh Fruits items and 5 packaged items and display them on the
console as a product menu for customers.
Ask users to select the products that they want to buy by selecting the IDs. Interaction
should be ongoing and happen over the command console or Graphical User Interface (GUI). Users can buy multiple products in one purchase.
Display the docket on the console which will have information about the total amount due (including tax) and total tax value in each purchase/transaction.
Use File I/O as the product database for at least 5 Fresh Fruits items and 5 packaged items to make your program more powerful and robust.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started