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)
- Is it more harder to design Graphical User Interfaces (GUI) with pixel coordinates?arrow_forwardSOURCES OF MESSAGE Messages in communication are sent in a form of sound waves or signals. This is the job of the transmitter. It converts the message into signals to be transmitted or sent through cables or other machines. Once the message has already been converted, it will pass through a channel, the medium used to send a message. Your answers in Item Number 3 are examples of channels. Can you thìnk of another examples of channel you frequently used in sending a message? Write them in the box below. CHANNEL inates ts Wers in len ssage Since a message has been initiated, converted into a signal, and sent through a medium, it will now reach its destination. But before that, the converted message should be decoded first. This is the job of the receiver. It is the one that translates the message, in a form of a signal or sound wave, into a form that can be understood by the destination or recipient of the message. sues f esse wite ses cv The receiving end in this communication model is…arrow_forwardArduino programming exercises using Uno Microcontroller Write a program that operates a train crossing light. The lights should flash at a rate of 2 Hz (on, off, on, off in 1 second) and operate for 20 seconds. How do I make it operate for 20 seconds? My code: int RedLED = 7;int GreenLED = 3; void setup() { pinMode(RedLED, OUTPUT); pinMode(GreenLED, OUTPUT); } void loop() { { digitalWrite(RedLED, HIGH); // it will set led to on mode delay(1000); //it will wait for 1 second before turning off the LED digitalWrite(RedLED, LOW); // It will turn off the LED delay(1000); // It will wait for 1 second before Turning the LED High again. digitalWrite(GreenLED, HIGH); // it will set led to on mode delay(1000); //it will wait for 1 second before turning off the LED digitalWrite(GreenLED, LOW); // It will turn off the LED delay(1000); // It will wait for 1 second before Turning the LED High again.} }arrow_forward
- C++ Languagearrow_forwardThe token bucket algorithm is a popular method for traffic shaping. A computer uses a token bucket with acapacity of 400 megabytes (MB) and a rate of 10 MB/sec. The computer continuously generates20 MB/sec for transmission from time 0. Assume the bucket’s water level is 200 MB at time 0.1a. How long will it take to send 1000 MB? Show the steps.1b. Draw a figure showing how the bucket’s water level evolvesarrow_forwardScaling Transformations: A 2D point can be scaled by multiplication of the coordinate values (x,y) by scaling factors Sx and Sy to produce the transformed coordinates (x,y'). Translation Transformations: A 2D point can be translated by adding the coordinate values (x,y) by Translation distances Tx and Ty to produce the transformed coordinates (x,y'). Rotation Transformations: A 2D point can be rotated by repositioning it along a circular path in the xy plane. We specify the rotation angle and the position of the rotation point about which the object is to be rotated. Multiplication of the coordinate values (x,y) by rotation matrix produce the transformed coordinates (x,y'). Now you have to design a program which will provide you with the option that which type of transformation you want to do. Like the following, Enter your choice: 1. Translation 2. Scaling 3. Rotation 4. Exit After providing the choice you have to enter the number of edges of a polygon and then you have to input the…arrow_forward
- Draw 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_forwardYellow Dots of Mystery: Is Your Printer Spying on You? "Imagine that every time you print a document, it automatically includes a secret code that could be used to identify the printer -- and, potentially, the person who used it. Sounds like something from a spy movie, right? Unfortunately, the scenario isn't fictional. Most color laser printers and color copiers are designed to print invisible tracking codes across every single printed page of their output. These codes reveal which machine produced a document and, in some cases, when the document was printed or copied. " EFForg, and Instructables. "Yellow Dots of Mystery: Is Your Printer Spying on You?" Instructables, Instructables, 29 Aug. 2022, https://www.instructables.com/Yellow-Dots-of- Mystery-Is-Your-Printer-Spying-on-/. Describe your reaction to this information did you know about these invisible tracking codes? Do you think printer manufacturers have an obligation to inform customers about this? Why or why not?arrow_forwardSubject=Digital Logic Design Need Conclusion Nothing else. A building security system works such that it uses the following ways of intrusion detection. Security cameras Motion sensors Security Guard The system works such that when an intruder is detected by either security cameras or motion sensors or the guard, the system not only sounds an alarm but also sends an sms alert to the security supervisor of the building.arrow_forward
- SPIM simulator (QtSpim). Simulation: Write a MIPS program that computes the expression; y = A * B + C * D Where A, B, C, and D are integersarrow_forwardIn PPC, examples of a "Conversion" are (pick all that apply) Group of answer choices talking to a sales person signing up for a newsletter purchasing a new car clicking on an advertisementarrow_forwardComputer Networking Lab: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