Q3. (15 marks)using c/c++
Write a COMPLETE Console Application that allows user to work with a database of 20 numbers. The program should:
C++ CODE:
#include<iostream>
using namespace std;
int main()
{
int arr[20];
int count=0;
while(true)
{
cout<<endl;
cout<<"1: List the existing numbers"<<endl;
cout<<"2: Add a number to the array"<<endl;
cout<<"3: Insert a number at a given location in the array:
"<<endl;
cout<<"4: Delete the number at the given
location"<<endl;
cout<<"5: Exit the program"<<endl;
cout<<"Enter choice: ";
int choice;
cin>>choice;
if(choice==1)
{
for(int i=0;i<count;i++)
cout<<arr[i]<<" ";
cout<<endl;
}
else if(choice==2)
{
if(count!=20)
{
int i;
cout<<"Enter number: ";
cin>>i;
arr[count++]=i;
}
}
else if(choice==3)
{
int loc,i;
cout<<"Enter location: ";
cin>>loc;
cout<<"Enter number: ";
cin>>i;
if(loc>=count)
arr[count++]=i;
else
{
for(int j=count-1;j>=loc;j--)
arr[j+1]=arr[j];
arr[loc]=i;
count++;
}
}
else if(choice==4)
{
int loc,i;
cout<<"Enter location: ";
cin>>loc;
for(int i=loc;i<count;i++)
arr[i]=arr[i+1];
count--;
}
else
break;
}
}
Output:


Q3. (15 marks)using c/c++ Write a COMPLETE Console Application that allows user to work with a...