| 332 | return arr3; |
| 333 | } |
| 334 | int main() |
| 335 | { |
| 336 | Array *arr1; |
| 337 | int ch,sz; |
| 338 | int x,index; |
| 339 | |
| 340 | cout<<"Enter Size of Array"; |
| 341 | scanf("%d",&sz); |
| 342 | arr1=new Array(sz); |
| 343 | |
| 344 | do |
| 345 | { |
| 346 | cout<<"\n\nMenu\n"; |
| 347 | cout<<"1. Insert\n"; |
| 348 | cout<<"2. Delete\n"; |
| 349 | cout<<"3. Search\n"; |
| 350 | cout<<"4. Sum\n"; |
| 351 | cout<<"5. Display\n"; |
| 352 | cout<<"6.Exit\n"; |
| 353 | |
| 354 | cout<<"enter you choice "; |
| 355 | cin>>ch; |
| 356 | |
| 357 | switch(ch) |
| 358 | { |
| 359 | case 1: cout<<"Enter an element and index "; |
| 360 | cin>>x>>index; |
| 361 | arr1->Insert(index,x); |
| 362 | break; |
| 363 | case 2: cout<<"Enter index "; |
| 364 | cin>>index; |
| 365 | x=arr1->Delete(index); |
| 366 | cout<<"Deleted Element is"<<x; |
| 367 | break; |
| 368 | case 3:cout<<"Enter element to search"; |
| 369 | cin>>x; |
| 370 | index=arr1->LinearSearch(x); |
| 371 | cout<<"Element index "<<index; |
| 372 | break; |
| 373 | case 4:cout<<"Sum is "<<arr1->Sum(); |
| 374 | break; |
| 375 | case 5:arr1->Display(); |
| 376 | |
| 377 | } |
| 378 | |
| 379 | }while(ch<6); |
| 380 | return 0; |
| 381 | } |
nothing calls this directly
no test coverage detected