Open
Description
Java Assignment: Billing Stock System
Objective:
Create a Java program to manage a Billing Stock System that allows users to input product details, store them, and later search for product information using SKU (Stock Keeping Unit) number.
Requirements:
-
Create a class
Product
with the following attributes:- SKU (Unique Number)
- Product Name
- Product Quantity
- Single Product Price
-
Implement the following functionalities:
- Add multiple products.
- Search for a product using SKU and display the product details.
Input Section:
- Prompt the user to enter the SKU, Product Name, Product Quantity, and Single Product Price.
- Allow the user to add multiple products.
- After entering each product, ask the user if they want to add more products.
Output Section:
- Allow the user to search for a product using the SKU number.
- Display the total cost, product name, quantity, and single price of the searched product.
Sample Interaction:
--- Input Section ---
Enter SKU (Unique Number): 101
Enter Product Name: Books
Enter Product Quantity: 20
Enter Single Book Price: 120/-
Do you want to add more [Y/N]: Y
Enter SKU (Unique Number): 102
Enter Product Name: Toy
Enter Product Quantity: 5
Enter Single Book Price: 560/-
Do you want to add more [Y/N]: Y
Enter SKU (Unique Number): 103
Enter Product Name: Samosa
Enter Product Quantity: 250
Enter Single Book Price: 20/-
Do you want to add more [Y/N]: N
--- Output Section ---
------ Search Item ------
Enter Product Item Form SKU No .: 103
Total Cost: 5000/-
Product Name: Samosa
Quantity: 250
Single Price: 20/-
Guidelines:
- Create a
Product
class. - Create methods to add products and search products by SKU.
- Use appropriate data structures to store and manage products.
Instructions:
- Implement the
Product
class with appropriate attributes and methods. - Implement the
BillingStockSystem
class to manage product addition and searching. - Use
ArrayList
to store the products. - Test the program by running it and ensuring the sample interaction works as expected.