COM4011 Introduction To Programming Coursework | Arden University (AU)

Published: 04 Feb, 2025
Category Coursework Subject Computer Science
University Arden University (AU) Module Title COM4011 Introduction To Programming

Assignment Brief

As part of the formal assessment for the programme, you are required to submit an Introduction to Programming assignment. Please refer to your Student Handbook for full details of the programme assessment scheme and general information on preparing and submitting assignments. The assignment brief will specifically give details and instructions for the assignment.

Module grade: Coursework 100%

Learning outcomes:

After completing the module, you should be able to:

LO1: Develop an understanding of data structures and programming techniques in the context of a programming language.
LO2: Demonstrate an understanding of how programs are developed, i.e., from concept to development and testing.
LO3: Demonstrate an ability to write programs using appropriate structure and language rules.

Scenario

A small retailer would like a Java program for managing their stock. Some items may be withdrawn from the stock while new items may be added periodically. The retailer wants a convenient way to store this information and manage it effectively. Any errors in the management of the stock should be avoided as they can create issues for sales.

During the working week, when items are sold, the stock is updated and reorders are placed daily to restock items that have fallen below their threshold. The value for the threshold indicated in Table 1 indicates the minimum current stock level needed below which a re-order is triggered. The reorder quantity indicated in Table 1 is used for each item being reordered.

Stock table with typical items.

COM4011 Introduction To Programming Coursework

The retailer would like the programme to display the following menu:
Stock control menu
1. Enter stock data
2. Enter sales data
3. Exit
Figure 1. Menu to be displayed for the program.

Typical sales data for a day has been provided in Table 2

Item Qty Sold
bc4dd8 8
18b050 20
c47d16 4
6c1af3 5

Based on the stock from Table 1 and sales from Table 2, reorder list would be tabulated as illustrated:

Item bc4dd8 18b050 6c1af3
Current Level  14 15 9
Threshold 45 18 10
Reorder Qty     20     50 10
Unit cost     3.25     1.89     5.78
Subtotal 65.00 94.50 57.80

Total cost 217.30

Assignment Task

Task 1

Provide a flowchart and pseudo-code to display the menu as in Figure 1. Once an option is selected and the code for the option executed, the menu should be displayed again. The program should terminate only when the option for exit is selected.

a) Explain how you have validated user input (choice selection) and checked for any possible logical errors, while justifying the data types you have used.

b) Flowchart and pseudocode should use standard conventions and format such as indentations, capitalisation, descriptive names for variables/methods, keywords, operators etc.

c) The program should take the user input for menu options and execute the appropriate method. When option 1 is selected the method ‘StockData’ should be executed. When option 2 is selected the method ‘SalesData’ should be executed.

d) At this stage each method should only have a print statement such as ‘Enter current stock data for each item’ or ‘Enter sales completed for the day’. No actual choices for the items in stock or sales values are required. The complete Java methods for the selection of option 1 and option 2 will need to be written in task 2 and task 3 respectively.

Write a Java program based on the algorithm with comments to illustrate the program flow.

a) The program should take the user input for menu options and execute the appropriate method.
Test your program by displaying the menu and selecting the various options when the menu is displayed. Provide screenshots for the output of the program showing the correct execution of all menu options.
Provide the Java code for this task in the Appendix as text for verification.

Task 2

In this task you will write the algorithm, code and test the working of the method ‘StockData’. You must also create a suitable data structure to store the details of the stock items to be provided with their current stock among other details. This data structure should be accessible to read and write in both task 2 and task 3.

1 Provide a flowchart and pseudo-code for when option 1 is selected.

a) The algorithm should demonstrate the acceptance of the user input for the items in stock. The algorithm should accept the data from Table 1, along with appropriate data for an additional 5 items of your choice.

b) After entering all the stock data, the total cost of the stock should be displayed. e.g. for the stock data in Table 1, the message to be displayed would be ‘The total cost of stock is 328.52’.

c) Then the menu should be displayed for further user selection.

d) Explain how you have validated user input (choice selection) and checked for any possible logical errors, while justifying the data types you have used.

e) Flowchart and pseudocode should use standard conventions and format such as indentations, capitalisation, descriptive names for variables/methods, keywords, operators etc.

f) The subroutine should take user input from the keyboard for the choices and data entry.

g) The user input for items in stock should be stored using a suitable data structure.

Write a Java method ‘StockData’ based on the algorithm with comments to illustrate the program flow.

a) The method should employ only fixed arrays where necessary – dynamic arrays (i.e. ArrayList, vector, HashMap, etc.) are not to be used.

2) You will need to enter all the stock data from Table 1, and an additional 5 new items with appropriate stock data values of your choice. All this data should be entered using the keyboard as user input.

3) Test your program by embedding the complete Java code for the ‘StockData’ method in the program written in task 1.

4) Provide screenshots for outputs of the Java method for the user input you have used.

5) Provide the Java code for this task in the Appendix as text for verification.

Task 3

In this task you will write the algorithm, code and test the working of the method ‘SalesData’. You will need to use the data stored in task 2 to complete task 3.

  1. Provide a flowchart and pseudo-code for when option 2 is selected.

a) The algorithm should take the sales data from Table 2, with appropriate sales values for the additional 5 items you entered in task 2.

b) Once the sales data is entered, the total sales amount should be displayed. e.g. for the data in Table 1 and Table 2 the message to be displayed would be ‘The total sales amount is 206.83’. Then the reorder list should be displayed as in Table 3.

c) Then the menu should be displayed for further user selection.

d) Explain how you have validated user input (choice selection) and checked for any possible logical errors, while justifying the data types you have used.

e) Flowchart and pseudocode should use standard conventions and format such as indentations, capitalisation, descriptive names for variables/methods, keywords, operators etc.

Write a Java method ‘SalesData’ based on the algorithm with comments to illustrate the program flow.

a) The method should employ only fixed arrays where necessary – dynamic arrays (i.e. ArrayList, vector, HashMap, etc.) are not to be used.
You will need to enter all the sales data from Table 2, and appropriate sales values of your choice for the additional 5 items you entered in Task

2. All this data should be entered using the keyboard as user input.

  1. Test your program by embedding the complete Java code for the ‘SalesData’ method in the program written in task 1.
    Provide screenshots for outputs of the Java method.
  2. Provide the full Java code in the Appendix as text for verification. At this stage the program should include the code for the menu display and the completed methods ‘StockData’ and ‘SalesData’.

If you are too stressed about submitting your assignments and preparing for your exams, contact us and get the best assignment help in UK for all UK students. Our computer science expert writers will help you with Java assignment help as well as computer science assignment writing. Trust us for the best service that reaches you before the deadline. Sign up today to get coursework help and free solved assignments.

Online Assignment Help in UK