13 Pages
3359 Words
1. Introduction To : COM4011: Introduction to Programming
Repair Shop Management System is software designed to facilitate the management of customer requests and the production of appropriate statistics for a repair shop. The system provides a menu interface that can be readily accessed to input customer requests, view summary statistics for mechanics, or exit the program as needed. This project is primarily concerned with constructing a system that will efficiently manage customer information using fixed arrays and provide accurate validation for user input. The functionality of the system in this regard is split into three dimensions: the display of the menu and user interaction, the provision to input new requests from customers and the calculation and display of statistics of completed jobs by the different mechanics.
During the project course, input validation was given utmost importance to accept only valid information. The data structure used in the arrays with customer information helps in the proper organisation and storage of customer information. All the stages of development are tested to ensure that all the features, including navigation through menus and proper display of summary statistics, work correctly. The nature of the project allows room for further enhancements. The system as developed thus far focuses on the basic activities for the management of the repair shop.
2. Task 1: Menu Display
2.1 Description of Task 1
In Task 1 the objective is to design a very minimalistic menu system in which the user would browse through various options in the Repair Shop Management System. There are three options on the menu: making new requests from customers, outputting statistics, and exiting the program. Every time one of these options is chosen, the corresponding action is performed and the menu is then shown again until the user chooses to exit. This functionality is critical for allowing for an interactive user experience in managing customer data as well as reviewing relevant statistics.
The program flow initiates by printing the menu to the user, wherein the user selects the action by entering some number, such as 1, 2, or 3. Option 1 is going to be associated with the createCustomerRequest method, which at the moment does nothing but print a message indicating that it is a placeholder (Lau and Aziz, 2022). Option 2 invokes the method displaySummaryStatistics, and this also does nothing but print a placeholder message. Option 3 will allow the user to exit from the program.
Psuedo Code
![Psuedo Code Psuedo Code]()
Flow Chart
![Task 1 Flow Chart Task 1 Flow Chart]()
Figure 1: Task 1 Flow Chart
(Source: draw.io)
2.2 Validating User Input
Validation of user input is very important to ensure the correct functioning of the system. The program expects that a number has been entered between 1 and 3. If that is the case, then the correct method is called (Djeunang Mezafack et al., 2022). However, if a user enters anything invalid option number outside of this range or inputs something that is not the numeric-the system will print an error message asking the user to enter a valid option. This validation makes sure that invalid inputs are taken care of correctly by the program so that it does not crash or hang around doing something completely different from what was desired.
These are checked by using an if-else statement, which verifies whether the input from the user is on one of the expected values (1, 2, or 3). If the user's input does not match any one of these values, then the program provides feedback and waits for another choice. This makes the system more robust in that it avoids incorrect operations and forces the user to make correct ones.
2.3 Code Implementation for Task 1
The menu system is implemented with a do-while loop that makes sure that the menu is repeatedly displayed until the user decides to quit the program by selecting option 3. The program prints out the menu options and reads the user's input, and based on their choice, it calls the corresponding method (Zhang et al., 2020). During Task 1, up to this point, the createCustomerRequest and displaySummaryStatistics methods have only been used with placeholder print statements, such as "A customer request has been accepted" and "Summary statistics provided," respectively.
To scan the user's input from the console, the Scanner object is employed. The choice variable is used as an integer because the expected input should be between 1 and 3. It uses a do-while loop to repetitively display menus and an if-else structure to validate the input. As such, this keeps the menu functional and interactive while still guiding the user to make proper choices.
2.4 Testing Task 1
Testing has been done to ascertain that the menu system does indeed work fine under varied conditions such as taking the valid selection input, handling invalid inputs, and finally conditions for exiting the program.
Menu Display Screenshot: The menu display presents three options: Add customer requests, Display statistics, and Exit. In this screenshot, it can be seen how the program successfully displays the menu when it starts.
![Menu Display Menu Display]()
Valid Option Selection Screenshot: When a valid option has been selected by the user option of either 1 or 2, the program will print an appropriate placeholder message by the program. In this case, that would be either "A customer request has been accepted" or "Summary statistics provided."
Invalid Input Screenshot: In order to see if the program would take invalid input, the invalid option of entering a number outside the range was entered. The program gave an error message asking the user to re-enter a valid option.
![Invalid Option Selection Invalid Option Selection]()
Exit Option Screenshot: Success in selecting option 3 is accomplished by performing the exit process as shown in the screenshot below: The program will thus terminate gracefully.
3. Task 2: Adding Customer Requests
3.1 Description of Task 2
Task 2 aims to let people enter new customer requests into the Repair Shop Management System using the creation of the createCustomerRequest method. The method is a read on the user input regarding the details of the customer request: order ID, bay number, a mechanic's name, a job description, and the time needed for the job (O’Regan and O’Regan, 2018) . All this data is held in fixed-size arrays. The system further tests whether the data entered is validated before it gets stored.
In the system, the program does a pre-loading of a sample set of data so that realistic requests by customers can be simulated based on the project brief. The program used arrays for storing these customer details including order IDs, bay numbers, mechanics names, job descriptions, and minutes required to complete the jobs. When the user inputs other customer requests, the system puts them in the same arrays (Liang, 2019). In Task 2, five more newly input customer requests were added to the already set data to test the functionality of the system in handling pre-loaded and newly input data as well.
![Pseudo Code Pseudo Code]()
Flow Chart
Figure 5: ![Task 2 Flowchart Task 2 Flowchart]()
(Source: draw.io)
3.2 Validating User Input
In the development of a customer request method, validation is necessary to ensure that the data entered is correct and reflects what the system expects. The first validation made is on the order ID, to ensure that it is a positive integer so that the system does not accept negative or invalid order numbers (Evans et al., 2023). The bay number is limited to 1 to 5 because the shop has only five service bays available, so any number entered out of the range is requested by the system for a valid bay number. The name of the mechanic should be any one of Sam, Bill, Harjit, Jo, or Alam. This is to make sure that only valid mechanics are assigned to the job. If an invalid name is given, the system advises the user to enter a valid name of the mechanic. In like manner, the number of minutes the job will take up should be a positive integer (Horstmann, 2024). If the user input is negative number or zero then the system prompts the user to input a valid time.
All these verifications ensure that the constraint of the system is satisfied and that bad values are not passed into the storage. The language of the computer program for these verifications includes conditional checks through if-else statements. This ensures that, while guiding the user for correct input, the integrity of data is maintained
3.3 Code Implementation for Task 2
The code has been Implemented for the createCustomerRequest method for Task 2, which captures and stores customer requests in fixed-size arrays. When the user selects option 1 from the menu, the method prompts them to input various details as shown hereunder: it will ask the user for order ID, bay number, mechanic's name, job description, and the minutes required for the task. All these inputs are read from a Scanner object (Sabir et al., 2019). The program stores all this information in arrays. All the fixed-length arrays orderIDs, bayNumbers, mechanics, descriptions, and minutesRequired were allowed to hold a maximum of 20 entries. This means that the system is permitted to accept, at most, 20 requests made by customers at any one time (Barisal et al., 2019). A variable named requestCount was used to count the total number of requests entered into the system. This allows any new request to be stored in the corresponding index of the arrays.
The code contains comments that help lead the user through the flow of the program. For instance, for every read and validated input, data is stored in its corresponding array. After that, the system will increase a requestCount variable, indicating the newly added request. These comments from the code help in easy understanding of how the input would be processed and also stored.
3.4 Additional Customer Requests
Besides the sample data provided in the project brief, five more customer requests are keyed in to check the functionality of the system. The new requests inputted are the same as the pre-loaded ones for which they are stored in the same arrays of initial samples. The system still keeps these new requests. It can, thus, support both preloaded data and user input data. This is evident in the dynamic support of new customer requests by the system even though it uses fixed arrays. The data in the new request is stored in the next index of each array.
3.5 Testing Task 2
For Task 2, the testing was carried out by populating five new customer requests with the preloaded data. All inputs received after validation to ensure appropriate input into the order ID, bay number, name of the mechanic, job description, and time required (Pascarella et al., 2019). Upon successful input by the user in all fields, the system provided a confirmation message that said the customer request had been accepted and stored.
Additional Customer Requests Screenshot: In the screenshot, five new requests are added to the system successfully. In each of these new entries, the program gives a confirmation message, proof that this system handles the new customer requests in a way to preserves the integrity of the pre-loaded data.
![Additional Customer Addition Additional Customer Addition]()
Figure 6: Additional Customer Addition
(Source: VSCode)
4. Task 3: Displaying Summary Statistics
4.1 Description of Task 3
Task 3 focused on implementing the displaySummaryStatistics method, detailing a point-by-point summary of work accomplished by each mechanic in the repair shop. The method computes the number of jobs completed by each mechanic as well as the total number of minutes worked and the average time taken for every job. Such statistics prove important in reviewing the level of performance and work each mechanic has had to do. This data will be summarised in a way that the shop's management will be able to judge efficiency and identify imbalances in the workload performed by different mechanics (Su et al., 2019).
It makes use of the customer request data entered in Task 2, using fixed arrays. A summary is calculated based on the jobs assigned to each mechanic, using pre-loaded sample data as well as added customer requests from the user. The statistics for each mechanic as well as the overall total jobs, average time per job for the entire shop, are displayed.
Pseudo Code
Flowchart
Figure 7: ![Task 3 Flowchart Task 3 Flowchart]()
(Source: draw.io)
4.2 Data Structure and Usage
The inputted data for task 2 order IDs, bay numbers, mechanic names, job descriptions, and minutes required for each job are stored in fixed arrays. For Exercise 3, these arrays are used to calculate the summary statistics for each mechanic. The program iterates over the arrays of customer request data to calculate the total jobs, total minutes, and average time per job (Chatterjee, 2019). Each job with a specific mechanic is found by matching entries in the mechanic's array to the pre-created list of names for different mechanics, which include Sam, Bill, Harjit, Jo, and Alam. For each match, the system increases the count of jobs for that mechanic and adds minutes associated with the job to the total minutes worked, hence ensuring that all jobs have been covered and statistics are accurate for every mechanic.
The program loops through the arrays using a for loop to examine each of the customer's request entries. Inside the conditional statement within this nested loop is where the mechanic's name is compared, and the appropriate job count and total minutes are updated (Sharopova, 2024). The calculated totals are then used to determine the average minutes per job for each mechanic.
4.3 Code Implementation for Task 3
The method uses the for loop in implementing the function. That is to say, it traverses through the arrays that represent the customer requests. For each entry of the array, the mechanic name is compared with the list of valid mechanics. After finding a match, the system increments the job count and adds the job's minutes to the total for that particular mechanic. Finally, after processing all the requests of the customers, it calculates the average minutes per job for every mechanic by dividing the total number of minutes by the total number of jobs for that mechanic (Caceffo et al., 2019). Therefore, the output will be presented in tabular form showing the total number of jobs, total minutes, and average minutes per job for all the mechanics.
As mentioned above, the method mainly uses fixed-size arrays, defined in the project brief, to store data regarding customers and to calculate statistics. Loops and checks provide enough accuracy in counting every mechanic's jobs and minutes (Winkelmann et al., 2020). Comments in the program are provided while going through the data in a loop, for calculation, and finally, to output statistics.
Using the arrays makes sure that the system processes a fixed amount of requests (up to 20), while the additional customer requests in Task 2 are taken directly and added to the summary calculation. Control structures like loops and if-else statements make the program efficient because it runs through each job one after another and does its calculations.
4.4 Testing Task 3
Testing the displaySummaryStatistics method was done to ensure that statistics for each mechanic were accurately computed based on the pre-loaded sample data and a further five customer requests input during Task 2. The total jobs, total minutes, and average minutes per job for each of the mechanics were correctly calculated within the system.
Displaying Statistics Screenshot: displaySummaryStatistics method shows how the statistics for each of the mechanics are presented by the jobs allocated to him. All customer requests are thus processed correctly, including those sample data already loaded and the additional ones and the program calculate the total sums and averages to be displayed for each mechanic.
5. Challenges and Solutions
The problems that emerged during the development of the Repair Shop Management System involved handling and validating input from the user for different cases. For example, there is the need to validate that the input that was provided by the user would indeed result in producing valid data, including numbers falling within a specific range for the bay number, correct names of the mechanics, and positive values for job duration. Another challenge in managing the fixed array data structure that was used to store and retrieve customer requests was that the system should allow a mix of preloaded sample data and new requests not to exceed the limits of an array (Kozyri et al., 2019). A smooth transition from one task to another with logical flow has to be planned so that switching between menu options and executing related methods can be avoided, thus not raising any logical errors.
Input validation checks were used to overcome these issues. It would guarantee the correctness of data and alert the users with messages about invalid inputs. The fixed-size arrays were consistent with the project's constraints but ensured efficient storage and access to the data (Amasha et al., 2021). There was full testing at every level of the development of this program so that all aspects from input validation to computation statistics are in fine condition without causing any discrepancies or errors, hence building up a reliable and robust system.
6. Conclusion
The project implemented a system for adding customer requests and showing summary statistics for the shop's mechanics. The project was divided into three tasks, the first of which was displaying a menu, and the second of which was adding customer requests. The third task was to calculate statistics, and all the tasks were completed with an emphasis on smooth input handling by the user, exact storage of data, and output generation. The results obtained from the project demonstrate how the system would manage customer data and produce the required statistics. The solution provided was capable of allowing a secure interface to interact with the system; the fixed-size arrays were also used for efficient storage and retrieval of data within the developed constraints.
This system can be improved by a dynamic data structure to allow for unlimited requests from the customers, which in fact increases flexibility. Other features that can be incorporated into the system include error logging, along with a user-friendly graphical interface, to make the system more scalable and accessible.
Reference
Journals
- Amasha, M.A., Areed, M.F., Khairy, D., Atawy, S.M., Alkhalaf, S. and Abougalala, R.A., 2021. Development of a Java-based Mobile application for mathematics learning. Education and Information Technologies, 26, pp.945-964.
- Barisal, S.K., Behera, S.S., Godboley, S. and Mohapatra, D.P., 2019. Validating object-oriented software at design phase by achieving MC/DC. International Journal of System Assurance Engineering and Management, 10(4), pp.811-823.
- Caceffo, R., Frank-Bolton, P., Souza, R. and Azevedo, R., 2019, July. Identifying and validating java misconceptions toward a cs1 concept inventory. In Proceedings of the 2019 ACM Conference on Innovation and Technology in Computer Science Education (pp. 23-29).
- Chatterjee, P., 2019. Exploring the Generality of a Java-based Loop Action Model for the Quorum Programming Language. arXiv preprint arXiv:1904.00478.
- Djeunang Mezafack, R.A., Di Mascolo, M. and Simeu-Abazi, Z., 2022. Systematic literature review of repair shops: focus on sustainability. International Journal of Production Research, 60(23), pp.7093-7112.
- Evans, B.J., Clark, J. and Flanagan, D., 2023. Java in a Nutshell. " O'Reilly Media, Inc.".
- Horstmann, C.S., 2024. Core java, volume I: fundamentals. Pearson Education.
- Kozyri, E., Arden, O., Myers, A.C. and Schneider, F.B., 2019. JRIF: reactive information flow control for java. Foundations of Security, Protocols, and Equational Reasoning: Essays Dedicated to Catherine A. Meadows, pp.70-88.
- Lau, Z.J. and Aziz, R.A., 2022. Development of Spare Part Management System for Automotive Repairing Shop. Applied Information Technology And Computer Science, 3(1), pp.995-1012.
- Liang, Y.D., 2019. Introduction to Java programming and data structures: comprehensive version. Pearson.
- O’Regan, G. and O’Regan, G., 2018. Java programming language. The Innovation in Computing Companion: A Compendium of Select, Pivotal Inventions, pp.171-174.
- Pascarella, L., Bruntink, M. and Bacchelli, A., 2019. Classifying code comments in Java software systems. Empirical Software Engineering, 24(3), pp.1499-1537.
- Sabir, U., Azam, F., Haq, S.U., Anwar, M.W., Butt, W.H. and Amjad, A., 2019. A model driven reverse engineering framework for generating high level UML models from Java source code. IEEE access, 7, pp.158931-158950.
- Sharopova, M., 2024. JAVA PROGRAMMING IN THE LANGUAGE FLOWING INPUT AND RELEASE. Solution of social problems in management and economy, 3(1), pp.84-93.
- Su, P., Wang, Q., Chabbi, M. and Liu, X., 2019, August. Pinpointing performance inefficiencies in Java. In Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (pp. 818-829).
- Winkelmann, H., Dageförde, J.C. and Kuchen, H., 2020, September. Constraint-Logic Object-Oriented Programming with Free Arrays. In International Workshop on Functional and Constraint Logic Programming (pp. 129-144). Cham: Springer International Publishing.
- Zhang, X., Crabtree, J.D., Terwilliger, M.G. and Redman, T.T., 2020. Assessing students’ object-oriented programming skills with Java: The “Department-Employee” Project. Journal of Computer Information Systems.
Author Bio
My name is Casey Bennett and I have obtained my graduation, post-graduation and PhD from London Business School. I have been giving education to students for the last 7 years in the United Kingdom. I can help you deal with complex dissertation topics, assignments, and essays and finish them fast.