Assignment task
Write a java console application that allows the user to keep track of various items in a grocery shop. The application must allow the user to read, validate, store, display, sort and search the item name (String), item id (integer number), quantity of the item in-stock (integer number), factory price (double number) and shop price (double number) for N items in the grocery shop. N should be declared as a constant and it should be equal to the largest digit of your student id number (e.g. if your ID number is S0234111 then N should be equal to 4 and you can declare it as final int N=4;). The item name, item id, quantity of the item in-stock, factory price and shop price must be stored in five separate single dimension Arrays/ArrayLists (index 0 for item 1 and index N-1 for item N). The minimum and maximum id numbers which can be stored are 1 and 333. The minimum and maximum factory prices for each item which can be stored are $1 and $1000. The item id and factory price must be entered from the keyboard and a validation for minimum and maximum values must be done.
Your application should display and execute a menu with the following options. A switch statement must be used to execute the following menu options.
1. Read, validate and store all items
2. Calculate and store shop price for all items
3. Display all items
4. Sell an item
5. Display all items with the lowest factory price
6. Sort and display sorted items
7. Exit from the application
Program design -
You may use any design that meets the specification. However, a good design will adhere to the following guidelines:
- be logically correct
- be easy to read and maintain
- be well-designed
- use a UML activity diagram
- use appropriate classes, methods and fields
Testing - Testing is important. You should:
- List the different types of test cases.
- Display the results for each test case.
Attachment:- Assignment File.rar