Radio Frequency IDentification (RFID) chips are small tags that can beplaced on a product. They behave like wireless barcodes and can wirelessly broadcast an identification number to a receiver. One application of RFID chips is to use them to aid in the logistics of shipping freight. Consider a shipping container full of items. Without RFID chips, a human has to manually inventory all of the items in the container to verify the contents. With an RFID chip attached to the shipping container, the RFID chip can electronically broadcast to a human the exact contents of the shipping container without human intervention.
To model this application, write a base class called ShippingContainer that has a container ID number as an integer. Include member functions to set and access the ID number. Add a virtual function called getManifest that returns an empty string. The purpose of this function is to return the contents of the shipping container.
Create a derived class called ManualShippingContainer that represents the manual method of inventorying the container. In this method, a human simply attaches a textual description of all contents of the container. For example, the description might be “4 crates of apples. 10 crates of pears.” Add a new class variable of type string to store the manifest. Add a function called setManifest that sets this string. Override the getManifest function so that it returns this string.
Create a second derived class called RFIDShippingContainer that represents the RFID method of inventorying the container. To simulate what the RFID chips would compute, create an add function to simulate adding an item to the container. The class should store a list of all added items (as a string) and their quantity using the data structures of your choice. For example, if the add function were invoked three times as follows:
rfidContainer.add("crate of pears"); // Add one crate of pears rfidContainer.add("crate of apples"); // Add one crate of apples rfidContainer.add("crate of pears"); // Add one crate of pears |
At this point, the data structure should be storing a list of two items: crate of apples and crate of pears. The quantity of apples is 1and the quantity of pears is 2. Override the getManifest function so that it returns a string of all items that is built by traversing the list of items. In the example above, the return string would be “2 crate of pears. 1 crate of apples.“ Finally, write a main
You may need to convert an integer into a string. A simple way to do this in C++11 is: string s = to_string(intVariable);
Want to see the full answer?
Check out a sample textbook solutionChapter 15 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Using MIS (10th Edition)
Starting Out With Visual Basic (7th Edition)
C++ How to Program (10th Edition)
Database Concepts (7th Edition)
Starting Out with C++: Early Objects (9th Edition)
- sqrt(36)+ mod (100,5) *floor(-20.6); abs (round(-20.6) * real (3+61)); ceil(-20.6) /imag(2+5i)+ sqrt(25) mod (9,5)*real (10-3i)- abs(-10); sign (round(4.2)- sqrt(81)) ceil(3.8)/ imag(2+6i)-mod (4,2) floor (21.5)+ ceil(-5.5) - round (4.8) sqrt(36)+ mod (100,5) *floor(-20.6); abs(ceil(-20.6) * real(3+6i)); MATLABarrow_forwardThe steps that would be taken to send a message in a safe way are shown.arrow_forwardIs it more harder to design Graphical User Interfaces (GUI) with pixel coordinates?arrow_forward
- One out of a thousand soda cups you have is poisonous. You have ten test samples that you can use to look for poison. A single drop of poison will forever mark the test strip as positive.A test strip may have any number of droplets applied at once, and it may be used again and again (as long as the results are negative). Tests can only be performed once per day, and results don't come back for seven days. How could you identify the poisoned container in the shortest amount of time?A follow-up Create software to practise your strategy.arrow_forwardAbstract: the main purpose of this experiment is build real time system using PPI 8255 to control devices connected to. Problem description: assume that there are two devices are connected to port A and two sensors are connected to port B of PPI 8255. They work according to the following table Sensors (S1S2) Devices (DID2) 00 01 01 10 10 11 11 00 Write a program to control these two devices according to the values of sensors.arrow_forwarda manuscript page generally has about 500 words on it. if you read a manuscript in 1 minute and 24 seconds, what is your reading rate in words per minute? what is the number of pages you read per hour?arrow_forward
- Consider following project There exists a collection of free-floating buoys that provide navigation and weather data to air and ship traffic at sea. The buoys collect air and water temperature, wind speed, and location data through a variety of sensors. Each buoy may have a different number of wind and temperature sensors and may be modified to support other types of sensors in the future. Each buoy is also equipped with a radio transmitter (to broadcast weather and location information as well as an SOS message) and a radio receiver (to receive requests from passing vessels. Some buoys are equipped with a red light, which may be activated by a passing vessel during sea-search operations. If a sailor is able to reach the buoy, he or she may flip a switch on the side of the buoy to initiate an SOS broadcast. Software for each buoy must: maintain current wind, temperature, and location information; wind speed readings are taken every 30 seconds, temperature readings every 10 seconds and…arrow_forwardDraw a Frequency polygon, histogram and a cumulative frequency distribution for the following data: Frequency Class 7.1 to 7.3 7.4 to 7.6 7.7 to 7.9 8.0 to 8.2 8.3 to 8.5 8.6 to 8.8 8.9 to 9.1 3 5 9 14 11 6 2arrow_forwardVarian and Mateo are alchemists trying to outdo each other. Varian has created a magical device that converts lead into gold, and it works as follows. It has two receptacles. In the first, he places lead bars, in the second, he places one gold bar, and after muttering a magical incantation, the amazing device replicates whatever is in receptacle 2 as many times as there are lead bars in receptacle 1. Unfortunately though, there is a price to all this magic, and one of the lead bars in receptacle 1 gets consumed (see figure below). Varian doesn't mind too much though, because his device is built robustly, and he can just use it again with all the gold he already has in receptable 2, and the lead bars in receptacle 1. Mateo has only recently completed his apprenticeship and wants to prove that he is just as good as Varian, so upon seeing Varian's demonstration, claims that he can do just as well. Mateo is actually quite brilliant and succeeds at making a device that resembles…arrow_forward
- Principles of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage LearningSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningPrinciples of Information Systems (MindTap Course...Computer ScienceISBN:9781305971776Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning