Write the definition and implementation of class Measures. First, write the class's header then write the impelmentation. Finally, write the main() function. Use the supplement file as a guide, place your code in this single file, and use the upload feature in blackboard to submit your answer. Do NOT use an IDE or a compiler, just a simple text editor. I. Header of class Measures declares the following members ONLY. V Header guards V Define rate, a private variable of type int. V A public default constructor V A public non-default constructor with one int parameter V A destructor to print the message "Done" II. Implementation of class Measures members. Define the following three members ONLY: V default constructor, initialize rate to -1. V non-default constructor to initialize private members according to the parameters. v destructor to print the message "Done". III. main() to perform the following. Assume that setters and getters are defined (i.e., setRate and getRate). 1. Create a pointer named ptrM to point to instances of type Measures. Assign ptrM to the memory address of a dynamic instance on the heap. Create the instance using the non-default constructor with value 14. 2. Create an array of type Measures and size 50. 3. Using a loop, prompt the user to enter values for rate for all instances. Assume that setRate is defined. 4. Using the Range-Based FOR loop, count the number of instances with values of rate equal to the value of rate from the pointer ptrM defined in step 1. You must use ptrM for this step; assume getRate is defined. 5. Finally print the count value computed in step 4. Using IO manipulators, print the value of count in a column

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Explain well. Have a nice day:)

Write the definition and implementation of class Measures. First, write the class's header then write the
impelmentation. Finally, write the main() function. Use the supplement file as a guide, place your code in this
single file, and use the upload feature in blackboard to submit your answer. Do NOT use an IDE or a compiler,
just a simple text editor.
I.
Header of class Measures declares the following members ONLY.
V Header guards
V Define rate, a private variable of type int.
V A public default constructor
V A public non-default constructor with one int parameter
V A destructor to print the message "Done"
II. Implementation of class Measures members. Define the following three members ONLY:
V default constructor, initialize rate to -1.
V non-default constructor to initialize private members according to the parameters.
v destructor to print the message "Done".
III. main() to perform the following. Assume that setters and getters are defined (i.e., setRate and getRate).
1. Create a pointer named ptrM to point to instances of type Measures. Assign ptrM to the memory address
of a dynamic instance on the heap. Create the instance using the non-def ault constructor with value 14.
2. Create an array of type Measures and size 50.
3. Using a loop, prompt the user to enter values for rate for all instances. Assume that setRate is defined.
4. Using the Range-Based FOR loop, count the number of instances with values of rate equal to the value of
rate from the pointer ptrM defined in step 1. You must use ptrM for this step; assume getRate is defined.
5. Finally print the count value computed in step 4. Using IO manipulators, print the value of count in a column
Transcribed Image Text:Write the definition and implementation of class Measures. First, write the class's header then write the impelmentation. Finally, write the main() function. Use the supplement file as a guide, place your code in this single file, and use the upload feature in blackboard to submit your answer. Do NOT use an IDE or a compiler, just a simple text editor. I. Header of class Measures declares the following members ONLY. V Header guards V Define rate, a private variable of type int. V A public default constructor V A public non-default constructor with one int parameter V A destructor to print the message "Done" II. Implementation of class Measures members. Define the following three members ONLY: V default constructor, initialize rate to -1. V non-default constructor to initialize private members according to the parameters. v destructor to print the message "Done". III. main() to perform the following. Assume that setters and getters are defined (i.e., setRate and getRate). 1. Create a pointer named ptrM to point to instances of type Measures. Assign ptrM to the memory address of a dynamic instance on the heap. Create the instance using the non-def ault constructor with value 14. 2. Create an array of type Measures and size 50. 3. Using a loop, prompt the user to enter values for rate for all instances. Assume that setRate is defined. 4. Using the Range-Based FOR loop, count the number of instances with values of rate equal to the value of rate from the pointer ptrM defined in step 1. You must use ptrM for this step; assume getRate is defined. 5. Finally print the count value computed in step 4. Using IO manipulators, print the value of count in a column
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education