[Solved]Description Data Engineers Regularly Collect Process Store Data Task Develop Deeper Unders Q37300656
Description
Data Engineers regularly collect, process and storedata. In this task you will develop a deeper understanding of how Cprogramming language can be used for collecting, processing andstoring data. In this assignment you get the opportunity to buildan interactive program that can manage the list of flightsdeparting Sydney Airport.
The list is stored as an arrayof flight_t type structures
flight_t flights [MAX_NUM_FLIGHTS];
The flight_t is a structure typedeffor struct flight. The struct flight contains thefollowing fields
flightcode – arrayof MAX_FLIGHTCODE_LEN+1 chars (string)
departure_dt – a structureof date_time_t type as defined below
arrival_city – arrayof MAX_CITYCODE_LEN+1 chars (string)
arrival_dt – a structureof date_time_t type as defined below
Note that we now have a struct nested within a struct.The date_time_t is a structure typedef for structdate_time. The struct date_time contains the followingfields,
month – integer between 1 and 12(inclusive)
day – integer between 1 and 31(inclusive)
hour – integer between 0 and 23(inclusive)
minute – integer between 0 and 59(inclusive)
Your program interacts with the nested struct array inyour memory (RAM) and simple database file in your hard disk. Itshould provide the following features:
1. add a flight
Add a new flight tothe flights through the terminal. You should collect theinput by asking multiple questions from the user.
Enter flight code>
Enter departure info for the flight leaving SYD.
Enter month, date, hour and minute separated byspaces>
Enter arrival city code>
Enter arrival info.
Enter month, date, hour and minute separated byspaces>
2. display all flights to adestination
Prompt the following question
Enter arrival city code or enter * to show alldestinations>
The user may enter the abbreviationof MAX_CITYCODE_LEN characters for the arrival city. Theprogram should display all flights to the requested destination. Ifthe user input is *, display all flights.
The display format should is as follows.
Flight Origin Destination
—— ————— —————
VA1 SYD 11-26 09:54 LAX 11-26 18:26
Pay attention to the strict formattingguide:
Flight – leftaligned, MAX_FLIGHTCODE_LEN (i.e. 6) chars atmost.
Origin and Destination
City – left aligned, MAX_CITYCODE_LEN(i.e. 3)chars at most.
Month, day, hour, minute – two digits with leadingzeros
3. save the flights to the databasefile
Save the flights in the hard disk as abinary/text file named database. You may use your own formatto save the data. You should overwrite if database file alreadyexists.
4. load the flights from the databasefile
Read the database file and put the datainto flights. You may only read the data files created by yourown program. You should overwrite the flights array youhad in memory when loading from the file.
5. exit the program
Exit the interactive program.
Careless Users
Your program may assume that the input data type isalways the expected type i.e. when the program expects an integerthe user must enter an integer. However, a carelessuser may enter an input that is outside the expected range(but still of the expected data type). Your program is expected tohandle careless users. e.g.
Enter choice (number between 1-5)>
-1
Invalid choice
Or a careless user may try to add 365 as the month(month should be between 1 and 12). Or try to adda flight to the flights array when it alreadycontains MAX_NUM_FLIGHTS flights, etc.
Run the sample executable to futher understand theexpected behaviour.
Check the formatting ofthe flightcode
WARNING: Attempting this feature is recommended onlyfor advanced students who enjoy a small challenge. You may need todo your own research, but more than that you may have to becreative. By using incorrect techniques you could very wellintroduce more bugs in your code and it could be time consuming.The special techniques required for this purpose will not beassessed in the final exam.
Your program should be able to check the format ofthe flightcode. The first two characters ofthe flightcode should be uppercase letters (A-Z)representing the airline. The rest ofthe flightcode should be numerals (0-9) representing theflight number. There must be 1-4 numerals as the flight number partof the flightcode. No spaces in the flightcode.
Run the sample executable to further understand theexpected behaviour.
The database file
It is up to you to create your own data storage formatfor the database file. Your program should be able toread the database that was created by itself. You cancreate the databaseas a text or binary file.
You do NOT need to be able to createa database identical to the database of thesample executable. You do NOT need to be able to readthe database of the sample executable.
Expert Answer
Answer to Description Data Engineers regularly collect, process and store data. In this task you will develop a deeper understandi… . . .
OR

