Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that: 1) defines a filterS type (filterStack) that is much like a regular stack but 1. a) stores only filtered numbers,

image text in transcribed

Write a C++ program that: 1) defines a filterS type (filterStack) that is much like a regular stack but 1. a) stores only filtered numbers, that is, each filterS object encapsulates a stable integer, call it X (varies from object to object) stores only those values that are NOT evenly divisible by X e.g. if 33, 15, 11, 17, 28, 294,... pushed when X is 3 >11, 17, 28, stored 1. b) doubles in size automatically if storage space exceeded 2. c) implementation requires a .h AND a.cpp file (filterS.h, filterS.cpp) 2) tests this filterS type on integer data via a driver (P1.cpp) that 1. a) initializes at least four filterS objects three of which have X values of 2, 3, and 5) 1. b) Reads in integer data from P1lnput.txt file 2.Stoes allappropriately filixes ines, O, in the: flksS objecis 3. d) Dumps filterS object contents to Console (clearly formatted and multiple items per line) 1. e) is designed using FUNCTIONAL DECOMPOSITION You may NOT use C++vectors! Use arrays Each submitted program will be tested on the same P1Input.txt file Write a C++ program that: 1) defines a filterS type (filterStack) that is much like a regular stack but 1. a) stores only filtered numbers, that is, each filterS object encapsulates a stable integer, call it X (varies from object to object) stores only those values that are NOT evenly divisible by X e.g. if 33, 15, 11, 17, 28, 294,... pushed when X is 3 >11, 17, 28, stored 1. b) doubles in size automatically if storage space exceeded 2. c) implementation requires a .h AND a.cpp file (filterS.h, filterS.cpp) 2) tests this filterS type on integer data via a driver (P1.cpp) that 1. a) initializes at least four filterS objects three of which have X values of 2, 3, and 5) 1. b) Reads in integer data from P1lnput.txt file 2.Stoes allappropriately filixes ines, O, in the: flksS objecis 3. d) Dumps filterS object contents to Console (clearly formatted and multiple items per line) 1. e) is designed using FUNCTIONAL DECOMPOSITION You may NOT use C++vectors! Use arrays Each submitted program will be tested on the same P1Input.txt file

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

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions