MCPcopy Create free account
hub / github.com/SR-Sunny-Raj/Hacktoberfest2021-DSA / removeitem

Method removeitem

32. Java Programs/hotelManagement.java:426–545  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

424 }
425 }
426 void removeitem()
427 {
428
429
430 Scanner sc = new Scanner(System.in);
431 boolean flag0,flag1;
432 String Item;
433 int prize;
434 int ch;
435 displayMainMenu(main_menu);
436 System.out.print("Which catogeory : ");
437 ch=sc.nextInt();
438 System.out.print("Enter intem name to be remove : ");
439 Item=sc.next();
440 switch(ch)
441 {
442
443 case 1:
444 int i,j;
445 boolean flag;
446 for(i=0;i<list_southIndian.size();i++)
447 {
448 flag=list_southIndian.get(i).equals(Item);
449 if(flag==true)
450 {
451 list_southIndian.remove(i);
452 prize_southIndian.remove(i);
453 }
454
455 }
456 break;
457
458 case 2:
459 for(i=0;i<list_gujarati.size();i++)
460 {
461 flag=list_gujarati.get(i).equals(Item);
462 if(flag==true)
463 {
464 list_gujarati.remove(i);
465 prize_gujarati.remove(i);
466 }
467
468 }
469 break;
470
471 case 3:
472
473
474 for(i=0;i<list_chainies.size();i++)
475 {
476 flag=list_chainies.get(i).equals(Item);
477 if(flag==true)
478 {
479 list_chainies.remove(i);
480 prize_chainies.remove(i);
481 }
482
483 }

Callers 1

adminmenuMethod · 0.80

Calls 6

displayMainMenuMethod · 0.80
printMethod · 0.45
nextMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected