0% found this document useful (0 votes)
92 views5 pages

IFN556 2023 Sem2 Assessment2

This document provides instructions for Assessment 2 in IFN556, which involves creating a ProductStore application with a Product class and Program class. Part A details creating the Product class with category arrays, properties for product details, and constructors. Part B involves creating methods in the Program class to display introduction, get user input, display product lists, and call Product class methods. The main method will call these Program class methods. Students are instructed to test their code and submit their project file by the due date.

Uploaded by

jay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views5 pages

IFN556 2023 Sem2 Assessment2

This document provides instructions for Assessment 2 in IFN556, which involves creating a ProductStore application with a Product class and Program class. Part A details creating the Product class with category arrays, properties for product details, and constructors. Part B involves creating methods in the Program class to display introduction, get user input, display product lists, and call Product class methods. The main method will call these Program class methods. Students are instructed to test their code and submit their project file by the due date.

Uploaded by

jay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

IFN556 Assessment Semester 2 2023

IFN556 Assessment 2 - Programming Assignment

Weighting: 50% Total Marks: 100 Individual

Due Date: 11.59 pm 3rd November 2023

Submission: Online via QUT Canvas

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:

Part A: Product class contains the following:

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

Part B: Program class contains the following:

1. A method, public static void DisplayIntroduction(), to display introduction of


the project, including your last name, first name and student id in the display. All
displayed information must be surrounded within a border of your choice.
2. A Method, public static int InputValue(int min, int max), to input an integer
number that is between (inclusive) the range of a lower bound and an upper
bound. The method should accept the lower bound and the upper bound as two
parameters and allow users to re-enter the number if the number is not in the
range or a non-numeric value was entered.

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.

4. A Method, private static void GetProductData(Product[] products),


to fill an array of products. The method must fill the array with products which
are constructed from user input information (which must be prompted for).
Along with the prompt for a product id, it should display a list of valid product
categories and call method CheckString to make sure the inputted product id is
a valid format. If not, the user is prompted to re-enter a valid product id.

5. After the data entry is complete, write a Method,


public static void DisplayAllProducts(Product[] products),
to display information of all Products that have been entered including product
id, product name, product category, product quantity and product price. This
method must call the ToString method that has been created in Product class.

6. After the data entry is complete, write a Method,


private static void GetProductLists(Product[] products),
to display the valid product categories, and then continuously prompts the user
for category codes and displays the information of all products in the category
as well as the number of products in this category.
Appropriate messages are displayed if the entered category code is not a valid
code or there is no product in that category.

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.

A possible screenshot of running the application is given as below.


IFN556 Assessment Semester 2 2023
IFN556 Assessment Semester 2 2023

In completing your assignment, please take note of the following:

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.

--------------------------------

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy