Thursday, January 23, 2020
Essay --
1. Task: Write the title or the code of exercises that need to be completed (e.g. Lab Exercise 1) Lab Work 1 2. Objectives: List the objectives of doing the exercise 2.1. To learn how to use the array list 2.2. Create a generic class of Array list of 30 hotels 2.3.To complete Hotel ADT class 2.4 To display the name of all hotels and their location 2.5 Calculate and display the number of room for each Hotel that input by user 3. Algorithm and design: Write the steps to solve the problem and/or the design of the solution Hotel -sName : String -sDistrict : String -iNumRoom : int +Hotel() +Hotel(String,String,int) +getData(String,String,int) : void +getName() : String +getDistrict() : String +getNumRoom() : int +getCalculateTax() : double +isLarge() : boolean +display() : String Demo Hotel : Flow Chart START Declaration of all variable: sName,sInput, sDistrict,iNumRoom,bIsLarge,str Instantiate the ArrayList's object ArrayListhotelList = new ArrayList(30) Create Object H for(int iNo = 1; iNo Ask user to :use JoptionPane "Enter Hotel Name :" "Enter district of hotel :" "Enter room number :" "The Hotel is large? ( yes / no ) :" for(int iIndex = 0; iIndex System.out.println(display()); END 4. Code listings and output evidence: Program code and ... ....String) 4. Method setData in Class Hotel cannot be applied to given types 6. Total time (hours) taken to complete the exercise: Write the actual hours you took to do the exercise 5 hours 7. Comments of the easiness or difficulties or experience in completing the exercise: Comments about what you have learned from doing the exercises After completing this exercise, I had already know How to create an ArrayList.In my opinion this lab work is quite tough because I need to Search and list 30 real name Hotel in Malaysia.In this Task User must Also need to input 30 time of hotel information itââ¬â¢s became a problem because when I enter the input more than 10 time.my blue Jay will have a problem .either Iââ¬â¢t close Iââ¬â¢t self or Nothing appear at the JOptionPane show input dialog box. Cause of this problem I need to rewrite the hotel information to many time.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.