COIT 20245 - Introduction to Programming Assessment
Verified
Added on 2024/04/26
|16
|1328
|315
AI Summary
This assessment showcases a JAVA program using array of objects for a hotel booking system. It includes UML Class diagram, implementation output screenshots, test cases, and references.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
COIT 20245 - Introduction to Programming Assessment item 2—JAVA Program using array of objects Student Name: Amair Ali Mohammed Student ID: 12059308 0
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Contents UML Class diagram:........................................................................................................................2 How long it took to create the whole program................................................................................2 Problems encountered:.....................................................................................................................2 Implementation Output screenshots:...............................................................................................3 Test cases:......................................................................................................................................10 References......................................................................................................................................14 Appendix........................................................................................................................................15 List of Figures Figure 1 UML Class Diagram.........................................................................................................2 Figure 2 menu system......................................................................................................................3 Figure 3Appeared page when user selects menu option 1...............................................................4 Figure 4 Output of Menu 1..............................................................................................................4 Figure 5Appeared page when user selects menu option 2...............................................................5 Figure 6Appeared page when user selects menu option 3...............................................................6 Figure 7Searching of customer name..............................................................................................7 Figure 8Appeared page when user selects menu option 4...............................................................8 Figure 9Appeared page when user selects menu option 5...............................................................9 Figure 10Appeared page when user selects menu option 6...........................................................10 Figure 11Test Case 1.....................................................................................................................10 Figure 12Test Case 2.....................................................................................................................11 Figure 13Test Case 3.....................................................................................................................11 Figure 14 Test Case 4....................................................................................................................12 Figure 15 Test Case 5....................................................................................................................13 1
UML Class diagram: A model of Class Diagram is the stationary structure of the system. It helps in determining relationships among objects, classes, operations, and attributes (Goswami, 2012). Figure1UML Class Diagram Booking class in the image shown above is a parent class and Hotel class here is Child class. In both the classes all the attributes are private and methods are public. How long it took to create the whole program I completed this whole program in 1 week. Firstly I have researched for this program in 1 day. After that, I started to create a program. Problems encountered: First I faced problem in JOptionPane. When I clicked on cancel button it was giving Null pointer exception. I have solved this issue using exceptional handling. 2
Second I faced problem in validation like customer name can't be blank, a number of days can't be blank, maximum limit can't exceed but I have solved all these problems by doing research. Implementation Output screenshots: Figure2menu system 3
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Figure3Appeared page when user selects menu option 1 In the above figure, there are six menus which are ‘Enter customer name and days to stay', ‘Display all customer names, days and charges‘Display statistics', ‘Search for Booking’, ‘Sort the Bookings’ and ‘Exit the Application’. User among these menus can select any of the choices. Figure4Output of Menu 1 The above dialog box pops when the user selects choice 1 and the dialog box asks to enter the customer’s name. After typing name, the user can click on ‘OK’ and if he feels to withdraw then he can select ‘Cancel' button. 4
Figure5Appeared page when user selects menu option 2 The above page opens when the user selects option 2 which are ‘Display all customer names, days and charges’. This window consists of customer name, days to stay and charges. 5
Figure6Appeared page when user selects menu option 3 The above page opens when the user selects option 3 which is ‘Display Statistics’. The window appeared will consist information of the person who has the maximum stay which is Brayden for 14 days, a person with the minimum stay which is Antonio for 1 day, average stay days which is 7.0 days and lastly total charges which is $12130.00. 6
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Figure7Searching of customer name The above window appears when the user selects option 4. The Input box asks to enter customer’s name and here the user has entered ‘Pole’. 7
Figure8Appeared page when user selects menu option 4 After entering ‘Pole’ as customer name the software will display ‘Customer found’. Here customer name, days to stay and charges have appeared. 8
Figure9Appeared page when user selects menu option 5 When the user selects option 5 which is ‘Sort the bookings’, the bookings will be organized in accordance with the alphabetical order of customer name. 9
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Figure10Appeared page when user selects menu option 6 When the user clicks on menu 6 which is ‘Exit the application’ then a message will be displayed saying Thank you. Test cases: Now, here I will be showing some test cases to prove that software is working effectively, efficiently and properly. Table1Test Case 1 S.No.Test Case DescriptionPresumed OutcomeActual Outcome 1.When selecting option 1, if the user does not enter any customer name and leaves field blank by clicking OK. An error will occur as user needs to put some valid customer name. The error has displayed, a dialog box appears saying that Customer name cannot be left blanked. Figure11Test Case 1 10
Table2Test Case 2 S.No.Test Case DescriptionPresumed OutcomeActual Outcome 2.When selecting option 1, if the user does not enter any valueindaysfieldand leavesfieldblankby clicking OK. An error will occur as user needs to put some valid number of days. The error has displayed, a dialog box appears saying that days field cannot be left blanked. Figure12Test Case 2 Table3Test Case 3 S.No.Test Case DescriptionPresumed OutcomeActual Outcome 3.When selecting option 1, if the user does not enter a value of days field in the rangeof1to14instead types some value above 14 or below 1. An error will occur as user needs to putsomevalidnumberofdays ranging from 1 to 14. The error has displayed, a dialog box appears saying thatdaysfieldcannot containvaluesotherthan [1, 14]. Figure13Test Case 3 11
Table4Test Case 4 S.No.Test Case DescriptionPresumed OutcomeActual Outcome 4.When selecting option 1, if theuserentersinvalid customer name which does not exist in the table of the the customer name. An error will occur as user needs to putsomevalidcustomername which exists on the table. Theerrorhasdisplayed saying that customer name is not found. Figure14Test Case 4 Table5Test Case 5 S.No.Test Case DescriptionPresumed OutcomeActual Outcome 5.When selecting option 1, if theuserenters‘Pole’as customer name. The given name will be searched and the software will display the details of the customer including name, days to stay and charges. The presumed outcome is the real result. 12
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
References Coderanch. (2018). How to use the canceled button in JOptionPane[online]Coderanch. Available at:https://coderanch.com/t/528000/java/canceled-button-JOptionPane [Accessed 25 Jan. 2018]. DaniWeb. (2018).JAVA: code for menu selection using Scanner class. [online] DaniWeb.Available at: https://www.daniweb.com/programming/software-development/threads/13786/java-code- for-menu-selection-using-scanner-class[Accessed 25 Jan. 2018]. Goswam, M. (2018).UML2 Class Diagram in Java - DZone Java. [online]dzone. Available at:https://dzone.com/articles/uml2-class-diagram-java[Accessed 25 Jan. 2018]. 14