INTRODUCTION The goal of this project is to enable the student to implement a simple C++...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
INTRODUCTION The goal of this project is to enable the student to implement a simple C++ program whose code is broken into three source files. At the same time, the student utilizes standard C++ libraries. HIGH LEVEL SPECIFICATION Write a program that first asks for the number of items to be ID stamped. The program then loops as many times as the number that was input. For each loop pass, the program asks for a description and generates a unique integer to be the identifier of the item. The program then displays a message stating that the unique identifier for the given product it the generated number. REQUIRED LIBRARIES Library name iostream cstdlib string chrono Other Purpose contains definitions of cin, cout, endl, and input/output operators contains rand() and srand() for random number generation contains definition of type string contains definitions of time functions you may include other libraries as needed for additional functionality you wish to add. DATA STRUCTURE Write a C++ class called ID_stamp that you will save in a file called ID_stamp.h which has the following: Private data members: variable named stamp of type integer • variable name desc of type string for product description Public function members: These functions should be declared in the class and defined outside the class. • Input data function that has no parameters and returns nothing. The function should display a message prompting for input of a description string. It should then read keyboard input of a string (you may use getline()). Your program then extracts the current time using now() function of chrono. This is passed to the rand() function to generate an integer that will be considered the unique identifier assigned to stamp. • Display data function that outputs both the entered string and the stamp to the screen with description and formatting added. PROCESSING Write a main() function that instantiates (declares) an object of type ID_stamp. Next, a prompt of number of items to stamp is displayed followed by reading an integer. A loop is then entered that runs as many times as the integer just read and does the following: • call the input data function call the display data function The main() function and all code associated with it should be saved in a file called ID_stamp_driver.cpp INTRODUCTION The goal of this project is to enable the student to implement a simple C++ program whose code is broken into three source files. At the same time, the student utilizes standard C++ libraries. HIGH LEVEL SPECIFICATION Write a program that first asks for the number of items to be ID stamped. The program then loops as many times as the number that was input. For each loop pass, the program asks for a description and generates a unique integer to be the identifier of the item. The program then displays a message stating that the unique identifier for the given product it the generated number. REQUIRED LIBRARIES Library name iostream cstdlib string chrono Other Purpose contains definitions of cin, cout, endl, and input/output operators contains rand() and srand() for random number generation contains definition of type string contains definitions of time functions you may include other libraries as needed for additional functionality you wish to add. DATA STRUCTURE Write a C++ class called ID_stamp that you will save in a file called ID_stamp.h which has the following: Private data members: variable named stamp of type integer • variable name desc of type string for product description Public function members: These functions should be declared in the class and defined outside the class. • Input data function that has no parameters and returns nothing. The function should display a message prompting for input of a description string. It should then read keyboard input of a string (you may use getline()). Your program then extracts the current time using now() function of chrono. This is passed to the rand() function to generate an integer that will be considered the unique identifier assigned to stamp. • Display data function that outputs both the entered string and the stamp to the screen with description and formatting added. PROCESSING Write a main() function that instantiates (declares) an object of type ID_stamp. Next, a prompt of number of items to stamp is displayed followed by reading an integer. A loop is then entered that runs as many times as the integer just read and does the following: • call the input data function call the display data function The main() function and all code associated with it should be saved in a file called ID_stamp_driver.cpp
Expert Answer:
Answer rating: 100% (QA)
CODE with explanation in the comments include include include using namespace std st... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Develop a computer program in the Java language to create classes of Rectangle, Triangle, and Circle that inherit from the generic class called Shape. ?? ? PROGRAMMING II: CLASSROOM ACTIVITY...
-
The purpose of this project is to use two light sensors (photoresistors) to measure light intensity in two opposite positions (0 & 180) and indicate the position with a servomotor. The materials...
-
The goal of this project is to choose and evaluate clustering mechanisms. Use datasets from the UCI Machine Learning Repository. If you wish to use other datasets in place of these, please give me a...
-
Aussie Infonautics, Inc., produces handheld Windows CE¢-compatible organizers. Aussie Infonautics markets three different handheld models. PalmPro is a soupedup version for the executive on the...
-
List the types of membranes found in the body, their functions, and their locations?
-
Apply the moment-distribution method to determine the moment at each joint of the parabolic haunched frame. Supports A and B are fixed. Use Table 132. The members are each 1 ft thick. E is constant....
-
Consider the following cash flow profile and assume MARR is 10 percent/year. a. What does Descartes' rule of signs tell us about the IRR(s) of this project? b. What does Norstrom's criterion tell us...
-
Below and on page 278 are statements of earnings and financial position for Wexler Industries. a. Use professional judgment in deciding on the preliminary judgment about materiality for earnings,...
-
The following data is provided for Garcon Company and Pepper Company for the year ended December 31. Finished goods inventory, beginning Work in process inventory, beginning Raw materials inventory,...
-
I farm on a small scale. Last year, I started off by planting soybeans and corn. This year, the price of soybeans increased, and the price of corn remained the same. Naturally, I planted more corn...
-
Mimi has eight new summer outfits. She plans to pack three of the new summer outfits in her trip to Tokyo. (a) How many different ways can the three summer outfits be selected? (b) Please describe...
-
If a space traveler were 50 years old when he left his galaxy in 2007 , how old would he be if he returned in 2025 if he had traveled at a rate of 2.8 x 10^8 m/s?
-
In 2.0 s a car increases its speed from 60 mi/h (or mph) to 62 mi/h (or mph) while a bicycle goes from rest to 2.0 mi/h (or mph). Which has the greater acceleration? Elaborate your answer.
-
Sam bought a car with a loan that required paying $500 every month for 3 years. The interest is 2.25% compounded monthly. How much total interest will Sam pay?
-
A worker stands on the roof of a 45.0m high building that is under construction. He throws a bag of debris giving it an initial velocity of 12.0m/s at an angle of 33.0 from a downward direction. How...
-
A 200g piece of platinum is placed inside a furnace until it is in thermal equilibrium. The platinum is then placed in a 100g aluminum calorimeter containing 400g of water at 5 degrees Celsius. If...
-
1. Use MATLAB's fminunc () function to find the maxima and minima of the following functions. Plot the functions on the given range and use the plots to estimate the starting point for each minima or...
-
Juarez worked for Westarz Homes at construction sites for five years. Bever was a superintendent at construction sites, supervising subcontractors and moving trash from sites to landfills. He...
-
A utility company was interested in knowing if agricultural customers would use less electricity during peak hours if their rates were different during those hours. (Agricultural energy use is...
-
Go to a large parking lot or a large area where bicycles are parked. Choose a color or a manufacturer. Design a sampling scheme you can use to estimate the percentage of cars or bicycles of that...
-
Ask four friends to tell you their most amazing coincidence story. Use the material in this chapter to assess how surprising each of the stories is to you. Pick one of the stories, and try to...
-
Say that a firm has fixed costs of $100 and constant average variable costs of $25. a. Show AFC, VC, AVC, and MC in a table. b. Graph the AFC, ATC, AVC, and MC curves. c. Explain why the curves have...
-
An economic consultant is presented with the following total product table and asked to derive a table for average variable costs. The price of labor is $10 per hour. a. Help him do so. b. Show that...
-
Say a firm has $100 in fixed costs and its average variable costs increase by $5 for each unit, so that the cost of 1 is $25, the cost of 2 is $30, the cost of 3 is $35, and so on. a. Show VC, AFC,...
Study smarter with the SolutionInn App