Educational Objectives: After completing this assignment the student should have the following knowledge, ability, and skills:
Operational Objectives: Create (define and implement) classes Box, Cylinder, Plane, Vehicle, Car, Truck, Van, Tanker, and Flatbed and an object-oriented vehicle counter for use by the Department of Transportation (DOT).
Deliverables: Six (6) files: vehicles.h, vehicles.cpp, shapes.h, shapes.cpp, tracker.cpp, and log.txt
project build: build tester.x [0..5]: x build tracker.x [0..5]: x build trackerHybrid1.x [0..5]: x # our tracker using your shapes and vehicles build trackerHybrid2.x [0..5]: x # your tracker using our shapes and vehicles project tests: tester.x tester.com [0..5]: x tracker.x < segment0.data [0..5]: x tracker.x < segment1.data [0..5]: x tracker.x < segment2.data [0..5]: x tracker.x < segment_wide.data [0..5]: x trackerHybrid2.x < segment_wide.data [0..5]: x software engineering: code quality, requirements [-30..0]: ( x) dated submission deduction [2 pts per]: ( x) --- total [0..50]: xx
This project simulates an application called tracker for the Florida Turnpike Authority in which data from SunPass transponders is accumulated in real time using various sensing equipment. The sensors detect a SunPass-equiped vehicle and actively inquire further data when that vehicle is a truck. (The data is used, among other things, to charge a passage toll on the vehicle's SunPass account, thus eliminating the need to stop at toll booths. SunPass is valid on all toll roads and bridges in Florida.) For all vehicles a serial number is collected. The serial number can be decoded to determine the vehicle type (car, truck/van, truck/tanker, truck/flatbed), passenger capacity, and, for trucks, the dimensions of its carrier. Trucks actively respond with their DOT license number as well.
Tracker is set up at a specific point on a roadway, near a toll booth or a specific segment of limited access highway. Once activated, it keeps a running account of the SunPass equipped passing vehicles. It can report summary data and also can keep full reports of all vehicles passing the checkpoint within a certain time block. It also keeps track of individual toll charges and can produce a summary of the charges accumulated in a segment.
The current assignment focusses on the "client side" of the SunPass project. Using the various DOT Vehicle classes built in the preceding assignment, we build the tracker client program.
Create and work within a separate subdirectory cop3330/proj5. Review the COP 3330 rules found in Introduction/Work Rules.
Begin by copying the following files from the course home: into your proj5 directory:
proj5/segment0.data proj5/segment1.data proj5/segment2.data proj5/makefile proj5/deliverables.sh scripts/submit.sh area51/tracker_i.x
The naming of these files uses the convention that _s and _i are compiled from the same cource code on program (Sun/Solaris) and linprog (Intel/Linux), respectively. The area51 files are distributed only for your information, experimentation, and testing. You will not need these files in your own project.
Begin a log file named log.txt. This should be an ascii text file in cop3330/proj5 with the following header:
log.txt # log file for SunPass project <date file created> <your name> <your CS username>
This file should document all work done by date and time, including all testing and test results. A free-form section at the end may be used for any other purpose.
Begin by copying the various shapes and vehicles fils from the preceding project: shapes.h, shapes.cpp, vehicles.h, and vehicles.cpp. Be sure that these files remain identical to those from the preceding project.
If in the current project you find that the shape and vehicle classes require modification, be sure that you make the modifications in both projects and resubmit the preceding one, so that when we check the requirement above your submissions will pass that check.
Create a client program for all of these classes in the file tracker.cpp.
Turn in the files vehicles.h, vehicles.cpp, shapes.h, shapes.cpp, tracker.cpp, and log.txt using the submit script.
Warning: Submit scripts do not work on the program and linprog servers. Use shell.cs.fsu.edu to submit projects. If you do not receive the second confirmation with the contents of your project, there has been a malfunction.
You are to implement a client program tracker of the vehicle system described above.
Tracker processes data from a file that is input through redirection and sends results to standard output. (Thus tracker does not deal directly with files but reads from and writes to standard I/O.)
Tracker goes through the following processing loop:
Note that the tracker processing loop continues until zero is read for a segment size. It may be assumed that the file of data is correctly structured so that whenever an appropriate item is expected, it is next in the file. For all vehicles, the data will begin with the serial number sn and then give the passenger capacity pc. For all specific truck types, the next entry will be the DOTlicense DOTL followed by the dimension data d1 d2 d3(optional). For example, a car, truck, van, tanker, and flatbed would have these lines of data:
sn pc sn pc DOTL sn pc DOTL d1 d2 d3 sn pc DOTL d1 d2 sn pc DOTL d1 d2
The dimensional data should be interpreted in the order d1 = length, d2 = width or radius, d3 = height. Note that this is more or less self-documenting in the data file segment0.data. Note also that we will assume that each vehicle and its data are in a separate line of the input file.
Tracker should instantiate the objects of a segment using an array whose elements are of type Vehicle *, that is, pointer to type Vehicle. At the end of reading the segment data, this array should have pointers to vehicle objects representing the entire segment. These objects should exist until the line in the report representing the object is generated. NOTE: instantiate the objects with the "verbose" variable set to 0 = false (the default).
Use declared constants (not hardcoded literal values) for the following:
Check for a segment size greater than tracker can handle, and exit if that happens. Thus tracker would exit if either size 0 is read or some size greater than the declared constant 6.i above.
Your tracker.cpp source file should #include <vehicles.h>, but not any of the other project files. The distributed makefile should create separate object files vehicles.o, shapes.o , and tracker.o and then create the executable tracker.x.
Model executable tracker.x is for your information only - it is not needed for your project.
To execute tracker on a data file use redirection. For example, enter
prompt> tracker.x < segment2.data
to run tracker.x with the data file segment2.data as input.
Run the distributed executables for tester and tracker in LIB/area51/ to see how your programs are expected to behave.