Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction Modern shipping companies keep track of the location of time sensitive deliveries. Tracking numbers are numbers given to packages when they are shipped. Both

image text in transcribed

Introduction

Modern shipping companies keep track of the location of time sensitive deliveries. Tracking numbers are numbers given to packages when they are shipped. Both senders and receivers can use tracking numbers to view most recent shipping status and trace back to previous status, as shown in the picture above. The first status comes from the company shipping the package. In the example shown in the picture, the first status is Package has left seller facility and is in transit to carrier. The other statuses are scans at various distribution points within the shipper's system. In this project you will write C++ code to model package tracking.

In addition, when asked, your program should keep track of every shipping status and when it was updated. Since we do not know how many updates the shipping will have, we will have a Linked List that will keep track of every status.

You are given a simple text file containing actions: back, forward, or new. If the action is listed as new, the next line contains three items, time, location and status, separated by semicolon. See TBA688567081000.txt file for more details. TBA688567081000.txt shows you the example same as in the picture. You are to simulate package tracking based on this text file.

Objective

You are given partial implementations of two classes. ShippingStatus is a class that holds shipping status including location and status of the package, as well as when the status was recorded. The time visited is the number of seconds from the UNIX epoch, 00:00 Jan 1, 1970 UTC. C++ has a variable type that can handle this, named time_t.

PackageTracking is where the bulk of your work will be done. PackageTracking stores a linked list representation of all the status. It will be able to read the history from a text file.

The text file will have 3 basic commands: new, back, and forward. Back and forward will allow users to view the previous status and the next status of a package. New will provide a newly updated status.

You are to complete the implementations of these classes, adding public/private member variables and functions as needed.

You are allowed to use the C++ Standard Library containers (such as std::list, and std::list::iterator) for this project.

You are allowed to use or refer to the following implementations:

https://github.com/apanangadan/CSUF-CPSC_131/blob/master/DLinkedList.h

https://github.com/kevinwortman/thedatastructures/blob/master/doubly_linked_list.hh

https://github.com/kevinwortman/thedatastructures/blob/master/doubly_linked_list_example.cc

Your code is tested in the provided main.cpp.

Source Code Files

You are given skeleton code files with many blank areas. Your assignment is to fill in the missing parts so that the code is complete and works properly when tested.

ShippingStatus.h and ShippingStatus.cpp: Stores location and status of the package, as well as when the status was recorded.

PackageTracking.h and PackageTracking.cpp: Stores a linked list representation of all the shipping status for a given package.

This class contains a method to read item information from a text file. m_readTrackingFile() will read the full tracking chain from a file and follow the commands as specified in the file. Hint: use ifstream, istringstream, getline().

m_printPreviousUpdates() will print all previous status in the shipping chain when the package was shipped, all the way up to (but not including) the current status that you are viewing.

m_printFollowingUpdates() will print all status following the current status that you are viewing (inclusive) to the last status in the tracking chain.

m_printFullTracking() will print all the status updates in the tracking chain.

Main.cpp: The entry point to the application. The main() function will test the output of your functions. This is already completed but feel free to change it for your own testing (during grading we will use the original main file with more test examples).

README.md file. You must edit this file to include the name and CSUF email address of each student in your group. Do this even if you are working by yourself. We need this information so that we can enter your grades into Titanium. For example, if your group includes students Ada Lovelace and Charles Babbage, your README.md should be in this format:

Group members:

Ada Lovelace adalovelace@csu.fullerton.edu

Charles Babbage charlesbab@csu.fullerton.edu

Hints

Read code comments for more details of function descriptions.

Start by implementing the ShippingStatus class, then the PackageTracking class. It can be overwhelming working on the PackageTracking class so start with the constructor, then the m_addUpdate() function, then the m_moveBackward()and m_moveForward()functions.

Remember the PackageTracking class will include a linked list for the shipping history. It will also need an iterator or pointer to point to a specific status in the linked list.

Iterators are very similar to pointers. Both iterators and pointers can be tricky. Make sure youre keeping track of whether youre talking about an address or the object at that address. Remember to use the -> operator!

Stage 1 (Design):

The goal in this stage is to form a team, study the problem, and come up with a design to solve the problem. Your design should include:

What are the member variables for the classes and their types

A drawing of the relation between the objects of the two classes

Pseudocode (i.e an informal English outline of the processing steps) of all the member functions

Include the above information in a single PDF document and upload to Titanium. Include the names of the team members and their sections. You are encouraged to discuss your design with your instructor.

Shipped with AMZL US Tracking ID TBA688567081000 Saturday, January 20 5:10 PM Delivered Diamond Bar, US 9:49 AM Out for delivery Chino, US 1:11 AM Package arrived at a carrier facility Chino, US Friday, January 19 8-13 PM Shipment departed from Amazon facility San Bernardina, CALAFORNIA US 12:59 PM Shipment arrived at Amazon facility Son Bernardina, CALIFORNIA US Wednesday, January 17 11:22 AM Shipment departed from Amazon facility Hebron, KENTUCKY US Tuesday, January 16 2:49 PM Shipment arrived at Amazon facility Hebron, KENTUCKY US Monday, January 15 Package has left seller facility and is in transit to carrier Shipped with AMZL US Tracking ID TBA688567081000 Saturday, January 20 5:10 PM Delivered Diamond Bar, US 9:49 AM Out for delivery Chino, US 1:11 AM Package arrived at a carrier facility Chino, US Friday, January 19 8-13 PM Shipment departed from Amazon facility San Bernardina, CALAFORNIA US 12:59 PM Shipment arrived at Amazon facility Son Bernardina, CALIFORNIA US Wednesday, January 17 11:22 AM Shipment departed from Amazon facility Hebron, KENTUCKY US Tuesday, January 16 2:49 PM Shipment arrived at Amazon facility Hebron, KENTUCKY US Monday, January 15 Package has left seller facility and is in transit to carrier

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

Students also viewed these Databases questions

Question

Identify four types of stress.

Answered: 1 week ago