Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Visual studio: C++ Write a program that does the following: 1.Defines a class named Data that has the following members a. A vector of integers

Visual studio: C++

Write a program that does the following:

1.Defines a class named Data that has the following members

a. A vector of integers entitled numbers (Private)

b. Methods (Functions) (Public):

i. Display_Menu Prompts the user to choose one of the following

0. Quit

1. Input Numbers

2. Display Numbers

3. Search Numbers

4. Delete Numbers

ii. Input_Numbers (Allows user to push integers onto the vector entitled numbers)

iii. Display_Numbers (Outputs the content of the vector numbers)

iv. Search_Numbers (Searches the numbers vector and outputs the index of where it is found; it outputs a message that it was not found otherwise)

v. Delete_Numbers(deletes all integers in the vector numbers)

2. Define each method. You do not need to define a constructor for this class.

3. Define a main function that makes use of all members of a Data object. Allow the user to continue until they indicate that they want to quit.

[Sample Run on next page]:

image text in transcribed

Main Menu Quit Input Numbers 2- Display Numbers 3Search Numbers - Delete Numbers Input Numbers How many numbers will you input? 5 Input number 7 Input number 19 Input number 2-> 3 Input number 3-> 22 Input number 44 Main Menu Quit Input Numbers 2- Display Numbers 3Search Numbers - Delete Numbers Search Numbers What number do you want to search for? 22 was found at position3 Main Menu Quit Input Numbers 2- Display Numbers 3Search Numbers - Delete Numbers

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

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

Students also viewed these Databases questions

Question

1. How will you, as city manager, handle these requests?

Answered: 1 week ago