IFN556 2023 Sem2 Assessment2
IFN556 2023 Sem2 Assessment2
This Assignment is split into two Parts. The first part requires you to create a class
template. The second part requires you to create an Application class which will use
the class template and perform a number of specified tasks.
In this assignment, you are advised to use user-defined class, array of objects, array in
class, and all the methods to achieve the maximum marks.
Create a project ProductStore Application with a Product Class and a Program class
as detailed below:
1. Two public static arrays that hold codes (categoryCodes) and descriptions of the
popular Product categories (categoryNames) managed in a products store.
These codes are a-, b-, f-, t-, o-, corresponding to product categories Apparel,
Books, Foods, Toys, and Others.
2. Data fields for product id (productID) and product category name
(productCategoryName)
3. Auto-implemented properties that hold a product’s name (ProductName),
product’s quantity (ProductQuantity) and product’s price (ProductPrice).
4. Properties for product id and product category name. Assume that the set
accessor will always receive a product id of a valid format that has length is 4,
first letter is lowercase, second letter is a hyphen and ends with two digits. For
example, “a-11” and “b-22” are of valid format and refer to known categories
“Apparel” and “Books”. If the product id does not refer to a known category,
then the set accessor must retain the number and assign to the “o-” category. For
example, “q-23” will be assigned as “o-23”. The product category name property
is a read-only property that is assigned a value when the product id is set.
5. Two constructors to create a Product object:
- one with no parameter: public Product()
- one with parameter for all data fields:
public Product(string id, string name, int quantity, double price)
6. A ToString method, public override string ToString(), to return all information
of a product object.
IFN556 Assessment Semester 2 2023
3. A Method, public static bool CheckString (string id), to check if an input string
satisfies the following conditions: the string’s length is 4, the string starts with 1
lowercase character and one hyphen, and ends with 2 digits. For example, “a-
22” is a valid string, “s_23” or “A-1234” are not valid strings.
7. Write the Main method which will only contain calls to the other methods and
the necessary variable declarations:
(i) Call DisplayIntroduction() method to display introduction of the project
and your information.
IFN556 Assessment Semester 2 2023
(ii) Call the method InputValue to prompt the user for the number of
Products that is between 1 and 30 (inclusive).
(iii) Then call method GetProductData create an array of Products.
(iv) Then call method DisplayAllProducts to display all Products in the array.
(v) Then call method GetProductLists to allow the user to input a category
code and see the information of the category.
I. You should not use any C# concepts which have not been taught as part of Lectures
1 – 4.
II. You should develop your code using simple logic.
III. Test your code using your own test data covering multiple data sets.
IV. Your final code should not have any compilation/execution errors.
Project Deliverable:
Program Code
Zip your project file and upload this zipped file onto Canvas using IFN556 Programming
Assignment link under Assessment 2 in Modules. The link will be available only from
Monday 23rd Oct 2023.
You can upload only TWICE; only the latest submission will be marked.
Note:
Assessment submitted after the due date without an approved extension will not be marked and
will receive a grade of 1 or 0%. If special circumstances prevent you from meeting the
assessment due date, you can apply for an extension through the Student Services in SEF. If
you do not have an approved extension you should submit the work you have completed by the
due date and it will be marked against the assessment criteria. Do not send us email requesting
for extension.
--------------------------------