Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design the following menu-driven application using C++ Vector class. Implement the following five functions: 1. Add(vector &num) Prompts the user to provide a number and

Design the following menu-driven application using C++ Vector class. Implement the following five functions: 1. Add(vector &num) Prompts the user to provide a number and add that number into the vector 2. Remove(vector &num) Prompts the user to provide a number. If the number is found in the vector, it removes that number. Otherwise, it generates a message. 3. Empty(vector int> &num) 4. Count(vector &num) 5. Show(vector &num) Erases all the existing numbers from the vector. Counts the total available numbers in the vector. Show the existing members of the vector (order does not matter) It will generate a message if there is no existing member available. Do not use any global variable. Write necessary lines to test your code. Submit one cpp file in the blackboard.

Using c++ code. perferrable visual studio. attached is the instructions the sample output. and the .cpp file you should use. dont change the code given, just add in necessary requirements.

#include

using namespace std;#include #include int main(){ vector number; int input; while (true) { showMenu(); cin >> input; switch (input){ case 1: add(number); break; case 2: remove(number); break; case 3: empty(number); break; case 4: count(number); break; case 5: show(number); break; case 6: return 0; break; default: cout } cout } return 0;}

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

What element of SOX is most surprising to you?

Answered: 1 week ago