Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project, you will be using java to develop a theme park management software that will improve the parks visitors information system. The theme

In this project, you will be using java to develop a theme park management software that will improve the parks visitors information system. The theme park has one entrance gate, one exit gate, and 4 kingdoms with their internal gates. Visitors are allowed to visit these kingdoms in any order they want by scanning their bracelets in each kingdom gate. However, for marketing purposes, to be able to exit the park, they have to revisit these kingdoms in reverse order in their way out. For example, a visitor who visit kingdoms: 1,2,3, then 4 should scan their bracelets in their way out using the exit gates of kingdoms 4,3,2, then 1. Also, visitors can visit all kingdoms or any number of kingdoms they want.
The program will read as an input the visitors information from a text file (provided in .txt format), store it in the main memory, to facilitate the performance of several operations. Each visitor information includes the following:
First Name and Last Name, as Strings,
Pass Type as Boolean where 1 indicates a VIP pass holder and 0 indicates a regular
pass holder,
Phone number as a String of length 10,
Region as integer indicating the region number a visitor comes from.
The order of the kingdoms visited as integers.
Note: A region refers to an area that is part of the country. For example, in Saudi Arabia the regions would be Central, Eastern, Northern , ..etc., However, these regions will be dealt with as numbers (region (1), region (2), ..etc) instead of the names of the regions. Kingdoms on the other hand refer to the areas inside the theme park.
Therefore, the main task of this project is to design a suitable ADT (call it, ThemeParkADT) to store the visitors information and enable the following operations to be performed as fast as possible:
1. An operation to find visitors based on their last name: this function will be used to pull out visitors information using the last name
2. An operation to display the total number of regions visitors are coming from.
3. An operation to display the regions along with their number of visitors sorted by the
total number of visitors from this region (sorted in descending order).
4. An operation to display the number of visitors holding VIP passes from a specific
region.
5. An operation to display the current location of all visitors holding VIP passes.
6. An operation to check whether two VIP pass holder visitors from the same region,
given their phone number, are currently in the same kingdom.
Note: If the given visitors or one of them are not VIP pass holders, return false and display an informative message indicating that.
7. An operation to check whether two regular visitors from the same region, given their phone number, visited the kingdoms in the same order. The operation will return true if and only if the two visitors visited the same number of kingdoms in the same order. Note: If the given visitors or one of them are not regular pass holders, or do not come from the same region, return false and display an informative message indicating that.
Example:
Consider the following text file:
(Note the variables are separated by , and each visitors information is written in a separate line in the given format: FirstName, LastName, Region, PhoneNumber, order)
The output of each of the 7 operations are as follows:
Ahmad,AlAli,1,1,0555555555,2,3,4,1 Sara,AlAli,1,1,0544444444,4,3,2,1 Saleh,AlSaleh,2,0,0533333333,4,3,2,1 Omar,AlOmar,3,0,0522222222,1,3,2,4 Amal,Omran,1,0,0511111111,4,3,1 Salem,Salem,1,0,0512211122,4 Hala,Ameer,2,1,0500000000,1,2 Hind,Ameen,4,1,0505000000,1,2,3,4 Sami,Akram, 1,1 0504000000,2
Operation
Output
Operation (1) for the last name AlAli,
Visitor 1:
Name: Ahmad AlAli
Region: 1
VIP Pass holder: Yes
Phone number: 0555555555
Order of visiting the kingdoms: 2,3,4,1
Visitor 2:
Name: Sara AlAli
Region: 1
VIP Pass holder: Yes
Phone number: 0544444444
Order of visiting the kingdoms: 4,3,2,1
Operation 2
The total number of regions are 4
Operation 3
Region 1: 5 Region 2: 2 Region 3: 1 Region 4: 1
Operation 4 for region 1
The total number of VIP pass holders coming from Region 1 is 3
Operation 5
Ahmad AlAli in kingdom 1 Sara AlAli in kingdom 1 Hala Ameer in kingdom 2 Hind Ameen in kingdom 4 Sami Akram in Kingdom 2
Operation (6) for 0555555555 and 0544444444 from Region 1
True
Operation (6) for 0555555555 and 0504000000 from Region 1
False
Operation (7) for 0511111111 and 0512211122 from Region 1
False
Phase 1: (10 marks)
In the first phase of the project, you are asked to describe your suggested design of the ADT for the problem described above and perform the following tasks:
a) Give a graphical representation of the ADT to show its structure. Make sure to label the diagram clearly.
b) Write at least one paragraph describing your diagram from part (a). Make sure to clearly explain each component in your design. Also, discuss and justify the choices and the assumptions you make.
c) Give a specification of the operations (1), (2), (3), (4), (5), (6), and (7) as well as any other supporting operations you may need to read the text from a text file and store the results in the ADT (e.g., insert).
d) Provide the time complexity (worst case analysis) for all the operations discussed above using Big O notation. Assume that the number of visitors is n, the number of VIP pass holders is v, and the number of regular pass holders is g, and the number of regions is r.
image text in transcribed
image text in transcribed
image text in transcribed
In this project, you will be using java to develop a theme park management software that will improve the park's visitors' information system. The theme park has one entrance gate, one exit gate, and 4 kingdoms with their internal gates. Visitors are allowed to visit these kingdoms in any order they want by scanning their bracelets in each kingdom gate. However, for marketing purposes, to be able to exit the park, they have to revisit these kingdoms in reverse order in their way out. For example, a visitor who visit kingdoms: 1,2,3, then 4 should scan their bracelets in their way out using the exit gates of kingdoms 4,3,2, then 1. Also, visitors can visit all kingdoms or any number of kingdoms they want. The program will read as an input the visitors' information from a text file (provided in .txt format), store it in the main memory, to facilitate the performance of several operations. Each visitor information includes the following: - First Name and Last Name, as Strings, - Pass Type as Boolean where 1 indicates a VIP pass holder and 0 indicates a regular pass holder, - Phone number as a String of length 10 , - Region as integer indicating the region number a visitor comes from. - The order of the kingdoms visited as integers. Note: A region refers to an area that is part of the country. For example, in Saudi Arabia the regions would be Central, Eastern, Northern, ..etc., However, these regions will be dealt with as numbers (region (1), region (2), ..ete) instead of the names of the regions. Kingdoms on the other hand refer to the areas inside the theme park. Therefore, the main task of this project is to design a suitable ADT (call it, ThemeParkADT) to store the visitors' information and enable the following operations to be performed as fast as possible: 1. An operation to find visitors based on their last name: this function will be used to pull out visitors' information using the last name 2. An operation to display the total number of regions visitors are coming from. 3. An operation to display the regions along with their number of visitors sorted by the total number of visitors from this region (sorted in descending order). 4. An operation to display the number of visitors holding VIP passes from a specific region. 5. An operation to display the current location of all visitors holding VIP passes. 6. An operation to check whether two VIP pass holder visitors from the same region, given their phone number, are currently in the same kingdom. Note: If the given visitors or one of them are not VIP pass holders, return false and display an informative message indicating that. 7. An operation to check whether two regular visitors from the same region, given their phone number, visited the kingdoms in the same order. The operation will return true if and only if the two visitors visited the same number of kingdoms in the same order. Note: If the given visitors or one of them are not regular pass holders, or do not come from the same region, return false and display an informative message indicating that. Example: Phase 1: (10 marks) In the first phase of the project, you are asked to describe your suggested design of the ADT for the problem described above and perform the following tasks: a) Give a graphical representation of the ADT to show its structure. Make sure to label the diagram clearly. b) Write at least one paragraph describing your diagram from part (a). Make sure to clearly explain each component in your design. Also, discuss and justify the choices and the assumptions you make. c) Give a specification of the operations (1), (2), (3), (4), (5), (6), and (7) as well as any other supporting operations you may need to read the text from a text file and store the results in the ADT (e.g., insert). d) Provide the time complexity (worst case analysis) for all the operations discussed above using Big O notation. Assume that the number of visitors is n, the number of VIP pass holders is v, and the number of regular pass holders is g, and the number of regions is r

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions