Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objective: The main objective of this assignment is checking the students' ability to work with ADTs. In this week's assignment, you will be writing the
Objective: The main objective of this assignment is checking the students' ability to work with ADTs. In this week's assignment, you will be writing the interface of an ADT in order to conform to the requirements of a larger application. Description: A train station needs to keep careful records for various purposes. Train companies keep track of both staff and passengers For many types of long distance travel, companies may scan the names of passengers to make sure that no wanted criminals are hiding among the passengers. Usually, a company might hire several people to manually look at the passenger log. The company is realizing that automation of this process could save them a lot of money. They hire you, hoping to automate this process. Due to the fact that the company wants to make the program scalable, they insist that you use ADTs to hold all possible information of the passengers. This includes the passengers first name, last name, seat, zone, diet, whether the passenger has special needs, and whether the passenger is a minor. This information will come from a text file. At the moment, the train company does not have records for diet, special needs, or is a minor. While the company finds the information, they would like you to generate these member variables randomly. For the diet, a char value should be randomly generated with the following possible options: , for no dietary restrictions, "G, for gluten free, and 'V' for vegetarian. For special needs, a boolean value of true/false can be randomly generated. For the is minor category a boolean can be used. The age of the passenger should first be randomly generated, and then if the passenger's randomly generated age is less than 18, that passenger should be flagged as a minor. Objective: The main objective of this assignment is checking the students' ability to work with ADTs. In this week's assignment, you will be writing the interface of an ADT in order to conform to the requirements of a larger application. Description: A train station needs to keep careful records for various purposes. Train companies keep track of both staff and passengers For many types of long distance travel, companies may scan the names of passengers to make sure that no wanted criminals are hiding among the passengers. Usually, a company might hire several people to manually look at the passenger log. The company is realizing that automation of this process could save them a lot of money. They hire you, hoping to automate this process. Due to the fact that the company wants to make the program scalable, they insist that you use ADTs to hold all possible information of the passengers. This includes the passengers first name, last name, seat, zone, diet, whether the passenger has special needs, and whether the passenger is a minor. This information will come from a text file. At the moment, the train company does not have records for diet, special needs, or is a minor. While the company finds the information, they would like you to generate these member variables randomly. For the diet, a char value should be randomly generated with the following possible options: , for no dietary restrictions, "G, for gluten free, and 'V' for vegetarian. For special needs, a boolean value of true/false can be randomly generated. For the is minor category a boolean can be used. The age of the passenger should first be randomly generated, and then if the passenger's randomly generated age is less than 18, that passenger should be flagged as a minor
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started