{"id":11082,"date":"2022-12-19T06:51:14","date_gmt":"2022-12-19T06:51:14","guid":{"rendered":"https:\/\/www.prepbytes.com\/blog\/?p=11082"},"modified":"2023-04-18T12:29:53","modified_gmt":"2023-04-18T12:29:53","slug":"menu-driven-program-in-java","status":"publish","type":"post","link":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/","title":{"rendered":"Menu Driven Program in Java"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg\" alt=\"\" \/><\/p>\n<p>Menu Driven Programs enhance the interactiveness of the programs. These type of programs takes input from the user and according to the input, shows the output to the user. Here, we will be discussing the Menu Driven Program in Java.<\/p>\n<h2>Menu Driven Program<\/h2>\n<p>Menu Driven Program in Java is defined as a program that is driven by a menu that presents the user with a list of options from which to choose. These menus are commonly found in devices that use microprocessors, such as washing machines and ATMs.<\/p>\n<p>The use of a menu-driven system offers two benefits. First, input is simplified to a single keystroke, reducing the possibility of errors. Second, the system limits input characters, making them unambiguous. This results in an intuitive and user-friendly interface.<\/p>\n<p>Before discussing the code for the menu driven program in Java, let us first discuss some prerequisites that will assist us in the proper understanding of the menu driven program in Java.<\/p>\n<h2>Understanding the Switch-Case in Java<\/h2>\n<p>We have certain statements known as conditional statements in programming languages. They are used to execute the code only if a particular condition is satisfied. For instance, let us say that we input a number and we want to know whether this number is even or odd.<\/p>\n<p>The code for the same is shown below.<\/p>\n<h3>Even-Odd Program (Understanding If-Else in Java)<\/h3>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_11077 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_11077 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_11077 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_11077 .wpsm_nav-tabs > li.active > a, #tab_container_11077 .wpsm_nav-tabs > li.active > a:hover, #tab_container_11077 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_11077 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_11077 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_11077 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_11077 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_11077 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_11077 .wpsm_nav-tabs > li > a:hover , #tab_container_11077 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_11077 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_11077 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_11077 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_11077 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_11077 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_11077 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_11077 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11077 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_11077 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11077 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_11077 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_11077\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_11077\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_11077_1\" aria-controls=\"tabs_desc_11077_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_11077\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_11077_1\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"java\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\nimport java.util.*;\r\npublic class Main {\r\n\r\n    public static void main(String[] args) {\r\n        Scanner scn = new Scanner(System.in);\r\n        int n = scn.nextInt();\r\n\r\n        if(n % 2 == 0) System.out.println(&quot;The input number is even&quot;);\r\n        else System.out.println(&quot;The input number is odd&quot;);\r\n\r\n        scn.close();\r\n    }\r\n}\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_11077 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_11077 a\"),jQuery(\"#tab-content_11077\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Input:<\/strong><\/p>\n<pre><code>5<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<pre><code>The input number is odd<\/code><\/pre>\n<p><strong>Explanation:<\/strong> The code provided is a basic demonstration of how conditional statements work in Java. If a number can be divided by 2 without leaving a remainder (i.e. number%2=0), it is considered an even number. The &quot;if&quot; keyword is used to verify this condition. On the other hand, if the number cannot be divided by 2, it is an odd number, which is confirmed using the &quot;else&quot; keyword.<\/p>\n<p>We can also use if\u2013else\u2013if\u2013else ladder. For instance, consider the case when we take input from the user and we want to print whether the number is greater than 0, less than 0, or 0 itself. This can be done as shown below.<\/p>\n<h3>Understanding If Else-if Else Ladder: Positive, Negative or Zero Program<\/h3>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_11079 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_11079 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_11079 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_11079 .wpsm_nav-tabs > li.active > a, #tab_container_11079 .wpsm_nav-tabs > li.active > a:hover, #tab_container_11079 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_11079 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_11079 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_11079 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_11079 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_11079 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_11079 .wpsm_nav-tabs > li > a:hover , #tab_container_11079 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_11079 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_11079 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_11079 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_11079 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_11079 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_11079 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_11079 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11079 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_11079 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11079 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_11079 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_11079\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_11079\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_11079_1\" aria-controls=\"tabs_desc_11079_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_11079\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_11079_1\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"java\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\nimport java.util.*;\r\npublic class Main {\r\n\r\n    public static void main(String[] args) {\r\n        Scanner scn = new Scanner(System.in);\r\n        int n = scn.nextInt();\r\n\r\n        if(n &gt; 0) System.out.println(&quot;Greater than 0&quot;);\r\n        else if(n &lt; 0) System.out.println(&quot;Less than 0&quot;);\r\n        else System.out.println(&quot;Equal to 0&quot;);\r\n        \r\n        scn.close();\r\n    }\r\n}\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_11079 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_11079 a\"),jQuery(\"#tab-content_11079\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Input:<\/strong><\/p>\n<pre><code>3<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<pre><code>Greater than 0<\/code><\/pre>\n<p>So, \u201cif-else\u201d or \u201cif else-if else\u201d is one kind of conditional statement. The other kind of conditional statement in Java is switch-case which is used to create a menu-driven program in Java.<\/p>\n<p>For instance, if any of the following letters \u201ca,e,i,o,u\u201d are entered by the user, we display that they have entered a vowel. Otherwise, we can display that they have entered a consonant. This can easily be done by the if-else statements but now we will do it by using the Switch-Case.<\/p>\n<h3>Switch Case Program: Vowels and Consonants<\/h3>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_11080 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_11080 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_11080 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_11080 .wpsm_nav-tabs > li.active > a, #tab_container_11080 .wpsm_nav-tabs > li.active > a:hover, #tab_container_11080 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_11080 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_11080 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_11080 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_11080 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_11080 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_11080 .wpsm_nav-tabs > li > a:hover , #tab_container_11080 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_11080 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_11080 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_11080 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_11080 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_11080 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_11080 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_11080 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11080 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_11080 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11080 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_11080 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_11080\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_11080\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_11080_1\" aria-controls=\"tabs_desc_11080_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_11080\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_11080_1\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"java\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n    public static void main(String[] args) {\r\n        Scanner scn = new Scanner(System.in);\r\n        \r\n        char ch = scn.next().charAt(0);\r\n\r\n        switch(ch) {\r\n            case 'A':\r\n                System.out.println(&quot;It is a vowel 'A'&quot;);\r\n                break;\r\n            case 'E':\r\n                System.out.println(&quot;It is a vowel 'E'&quot;);\r\n                break;\r\n            case 'I':\r\n                System.out.println(&quot;It is a vowel 'I'&quot;);\r\n                break;\r\n            case 'O':\r\n                System.out.println(&quot;It is a vowel 'O'&quot;);\r\n                break;\r\n            case 'U':\r\n                System.out.println(&quot;It is a vowel 'U'&quot;);\r\n                break;\r\n            default:\r\n                System.out.println(&quot;It is a consonant&quot;);\r\n                break;\r\n        }\r\n\r\n        scn.close();\r\n    }\r\n}\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_11080 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_11080 a\"),jQuery(\"#tab-content_11080\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Input:<\/strong><\/p>\n<pre><code>A<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<pre><code>It is a vowel 'A'<\/code><\/pre>\n<p><strong>Explanation:<\/strong> In the switch case, we have a switch block, and inside the parenthesis of the switch block we have the variable on which the decision has to be made. Each case is specified separately as shown above and the \u201cbreak\u201d keyword is used to break out of the switch block if the case has been satisfied. Also, we have a \u201cdefault\u201d statement. This default statement is used to identify all the cases that are not covered separately above. <\/p>\n<p>So, these switch-cases are used to create what we call as a menu-driven program as these cases act like a menu to choose from. <\/p>\n<p>So, now that we have understood the conditional statements and especially the switch-case that is used to create a menu driven program, let us now learn how we can design an algorithm for Menu Driven Program in Java.<\/p>\n<h3>How to design an Algorithm for the Menu Driven Program in Java<\/h3>\n<p>Here is how we can design the algorithm for the menu driven program in java by following the given steps.<\/p>\n<ul>\n<li><strong>Step 1:<\/strong> Start the Java Program<\/li>\n<li><strong>Step 2:<\/strong> Take the choice of user as an input<\/li>\n<li><strong>Step 3:<\/strong> Repeat the process till the user is entering a valid choice<\/li>\n<li><strong>Step 4:<\/strong> In case of a invalid choice, stop the program<\/li>\n<\/ul>\n<p>Let us now write the code for the Menu Driven Program in Java.<\/p>\n<h2>Menu Driven Program in Java &#8211; Selecting Engineering Branch<\/h2>\n<p>So, the aim of this program is to provide a menu for the students to select their stream in a University. If they choose a stream from the given options, they will be shown the subjects of their chosen stream. Then, they will be asked whether they are sure about the stream they chose or not. If they are sure, they will be displayed the congratulations message on choosing the stream. If they are not sure, they will again be displayed the complete menu. So, the program is as shown below.<\/p>\n<h3>Menu Driven Program in Java<\/h3>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_11081 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_11081 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_11081 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_11081 .wpsm_nav-tabs > li.active > a, #tab_container_11081 .wpsm_nav-tabs > li.active > a:hover, #tab_container_11081 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_11081 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_11081 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_11081 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_11081 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_11081 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_11081 .wpsm_nav-tabs > li > a:hover , #tab_container_11081 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_11081 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_11081 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_11081 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_11081 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_11081 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_11081 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_11081 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11081 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_11081 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11081 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_11081 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_11081\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_11081\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_11081_1\" aria-controls=\"tabs_desc_11081_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_11081\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_11081_1\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"java\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n    public static void cse() {\r\n        System.out.println(&quot;You will get the following subjects&quot;);\r\n        System.out.println(&quot;DSA&quot;);\r\n        System.out.println(&quot;DBMS&quot;);\r\n        System.out.println(&quot;Computer Networks (CN)&quot;);\r\n    }\r\n\r\n    public static void it() {\r\n        System.out.println(&quot;You will get the following subjects&quot;);\r\n        System.out.println(&quot;DSA&quot;);\r\n        System.out.println(&quot;DBMS&quot;);\r\n        System.out.println(&quot;Computer Networks (CN)&quot;);\r\n        System.out.println(&quot;MPMC (Multi processor and Multi Controller)&quot;);\r\n        System.out.println(&quot;Information Security&quot;);\r\n    }\r\n\r\n    public static void ece() {\r\n        System.out.println(&quot;You will get the following subjects&quot;);\r\n        System.out.println(&quot;Wireless Communication&quot;);\r\n        System.out.println(&quot;Switching Theory and Logic Design (STLD)&quot;);\r\n        System.out.println(&quot;Mobile Systems Communication&quot;);\r\n    }\r\n\r\n    public static void ee() {\r\n        System.out.println(&quot;You will get the following subjects&quot;);\r\n        System.out.println(&quot;Switching Theory and Logic Design (STLD)&quot;);\r\n        System.out.println(&quot;Control Systems&quot;);\r\n        System.out.println(&quot;Electrical Circuits and Designs&quot;);\r\n    }\r\n\r\n    public static void mech() {\r\n        System.out.println(&quot;Force and Friction&quot;);\r\n        System.out.println(&quot;Motors and its Types&quot;);\r\n    }\r\n\r\n    public static void main(String[] args) {\r\n        Scanner scn = new Scanner(System.in);\r\n        \r\n        System.out.println(&quot;Welcome to PrepBytes University Portal!!!&quot;);\r\n        System.out.println(&quot;Select one of the following streams in which you want to study&quot;);\r\n        \r\n        while(true) {\r\n            System.out.println(&quot;1. Computer Science&quot;);\r\n            System.out.println(&quot;2. Information Technology&quot;);\r\n            System.out.println(&quot;3. Electronics and Communication&quot;);\r\n            System.out.println(&quot;4. Electrical and Electronics&quot;);\r\n            System.out.println(&quot;5. Mechanical&quot;);\r\n            System.out.println(&quot;10. Exit&quot;);\r\n\r\n            System.out.println(&quot;Enter the choice number from above&quot;);\r\n            int choice = scn.nextInt();\r\n\r\n            switch(choice) {\r\n                case 1:\r\n                    System.out.println(&quot;You have chosen Computer Science.&quot;);\r\n                    cse();\r\n                    System.out.println(&quot;Are you sure you want to lock this stream? Choose either A or B.&quot;);\r\n                    System.out.println(&quot;1. Yes, I'm sure&quot;);\r\n                    System.out.println(&quot;2. No, I'm not sure&quot;);\r\n                    int ch = scn.nextInt();\r\n                    if(ch == 1) {\r\n                        System.out.println(&quot;Congratulations!! You are now a CSE student at PrepBytes&quot;);\r\n                        return;\r\n                    }\r\n                    break;\r\n                case 2:\r\n                    System.out.println(&quot;You have chosen Information Technology.&quot;);\r\n                    it();\r\n                    System.out.println(&quot;Are you sure you want to lock this stream? Choose either A or B.&quot;);\r\n                    System.out.println(&quot;1. Yes, I'm sure&quot;);\r\n                    System.out.println(&quot;2. No, I'm not sure&quot;);\r\n                    int ch2 = scn.nextInt();\r\n                    if(ch2 == 1)  {\r\n                        System.out.println(&quot;Congratulations!! You are now an IT student at PrepBytes&quot;);\r\n                        return;\r\n                    }\r\n                    break;\r\n                case 3:\r\n                    System.out.println(&quot;You have chosen Electronics and Communication.&quot;);\r\n                    ece();\r\n                    System.out.println(&quot;Are you sure you want to lock this stream? Choose either A or B.&quot;);\r\n                    System.out.println(&quot;1. Yes, I'm sure&quot;);\r\n                    System.out.println(&quot;2. No, I'm not sure&quot;);\r\n                    int ch3 = scn.nextInt();\r\n                    if(ch3 == 1)  {\r\n                        System.out.println(&quot;Congratulations!! You are now an ECE student at PrepBytes&quot;);\r\n                        return;\r\n                    }\r\n                    break;\r\n                case 4:\r\n                    System.out.println(&quot;You have chosen Electrical and Electronics&quot;);\r\n                    ee();\r\n                    System.out.println(&quot;Are you sure you want to lock this stream? Choose either A or B.&quot;);\r\n                    System.out.println(&quot;1. Yes, I'm sure&quot;);\r\n                    System.out.println(&quot;2. No, I'm not sure&quot;);\r\n                    int ch4 = scn.nextInt();\r\n                    if(ch4 == 1) {\r\n                        System.out.println(&quot;Congratulations!! You are now an EEE student at PrepBytes&quot;);\r\n                        return;\r\n                    }\r\n                    break;\r\n                case 5:\r\n                    System.out.println(&quot;You have chosen Mechanical Engineering.&quot;);\r\n                    mech();\r\n                    System.out.println(&quot;Are you sure you want to lock this stream? Choose either A or B.&quot;);\r\n                    System.out.println(&quot;1. Yes, I'm sure&quot;);\r\n                    System.out.println(&quot;2. No, I'm not sure&quot;);\r\n                    int ch5 = scn.nextInt();\r\n                    if(ch5 == 1) {\r\n                        System.out.println(&quot;Congratulations!! You are now a ME student at PrepBytes&quot;);\r\n                        return;\r\n                    }\r\n                    break;\r\n                case 10:\r\n                    break;\r\n                default:\r\n                    System.out.println(&quot;Invalid choice&quot;);\r\n                    break;\r\n            }\r\n            if(choice == 10) break;\r\n        }\r\n        scn.close();\r\n    }\r\n}\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_11081 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_11081 a\"),jQuery(\"#tab-content_11081\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Output:<\/strong><\/p>\n<pre><code>Welcome to PrepBytes University Portal!!!\nSelect one of the following streams in which you want to study\n1. Computer Science\n2. Information Technology\n3. Electronics and Communication\n4. Electrical and Electronics\n5. Mechanical\n10. Exit\nEnter the choice number from above\n1\nYou have chosen Computer Science.\nYou will get the following subjects\nDSA\nDBMS\nComputer Networks (CN)\nAre you sure you want to lock this stream? Choose either A or B.\n1. Yes, I'm sure\n2. No, I'm not sure\n1\nCongratulations!! You are now a CSE student at PrepBytes<\/code><\/pre>\n<p><strong>Conclusion<\/strong><br \/>\nIn this article, we have learned about the menu driven program in Java. We have discussed some prerequisites such as if-else, and switch-case statements and then implemented the menu driven program in java. We hope that you have understood the complete concept of a menu driven program in Java.<\/p>\n<h2>Frequently Asked Questions(FAQs)<\/h2>\n<p>Here are some Frequently Asked Questions related to \u201cMenu Driven Program in Java\u201d.<\/p>\n<p><strong>Ques 1. What are the advantages of using a menu driven program in Java?<\/strong><br \/>\n<strong>Ans.<\/strong> Menu driven Program in Java has following advantages.<\/p>\n<ul>\n<li>A menu driven program in Java provides a simple and intuitive interface for the user to interact with the program. <\/li>\n<li>It also reduces the chances of input errors, as the user can select an option from the menu rather than typing in input manually.<\/li>\n<li>A menu driven program can be easily modified to include new options or functionality.<\/li>\n<\/ul>\n<p><strong>Ques 2. How do you handle invalid input in a menu driven program in java using switch case?<\/strong><br \/>\n<strong>Ans.<\/strong> To handle invalid input in a menu-driven program using switch case, you can include a default case in the switch statement. This code block can display an error message to the user and prompt them to enter a valid input. <\/p>\n<p><strong>Ques 3. Can a menu driven program in Java using switch case be nested?<\/strong><br \/>\n<strong>Ans.<\/strong> Yes, a menu driven program in Java using switch case can be nested. This means that a switch case statement can be included inside another switch case statement, allowing for multiple levels of options and functionality.<\/p>\n<p><strong>Other Java Programs<\/strong><\/p>\n<p><a href=\"https:\/\/prepbytes.com\/blog\/java\/java-program-to-add-two-numbers\/\" title=\"Java Program to Add Two Numbers\">Java Program to Add Two Numbers<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/java-program-to-check-prime-number\/\" title=\"Java Program to Check Prime Number\">Java Program to Check Prime Number<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/java-program-to-check-whether-a-number-is-a-palindrome-or-not\/\" title=\"Java Program to Check Whether a Number is a Palindrome or Not\">Java Program to Check Whether a Number is a Palindrome or Not<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/java-program-to-find-the-factorial-of-a-number\/\" title=\"Java Program to Find the Factorial of a Number\">Java Program to Find the Factorial of a Number<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/java-program-to-reverse-a-number\/\" title=\"Java Program to Reverse a Number\">Java Program to Reverse a Number<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/java-program-to-search-an-element-in-a-linked-list\/\" title=\"Java Program to search an element in a Linked List\">Java Program to search an element in a Linked List<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/program-to-convert-arraylist-to-linkedlist-in-java\/\" title=\"Program to convert ArrayList to LinkedList in Java\">Program to convert ArrayList to LinkedList in Java<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/java-program-to-reverse-a-linked-list\/\" title=\"Java Program to Reverse a linked list\">Java Program to Reverse a linked list<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/java-program-to-search-an-element-in-a-linked-list\/\" title=\"Java Program to search an element in a Linked List\">Java Program to search an element in a Linked List<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/anagram-program-in-java\/\" title=\"Anagram Program in Java\">Anagram Program in Java<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/inheritance-program-in-java\/\" title=\"Inheritance Program in Java\">Inheritance Program in Java<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/even-odd-program-in-java\/\" title=\"Even Odd Program in Java\">Even Odd Program in Java<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/hello-world-program-in-java\/\" title=\"Hello World Program in Java\">Hello World Program in Java<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/if-else-program-in-java\/\" title=\"If else Program in Java\">If else Program in Java<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/binary-search-program-in-java\/\" title=\"Binary Search Program in Java\">Binary Search Program in Java<\/a><br \/>\n<a href=\"https:\/\/prepbytes.com\/blog\/java\/linear-search-program-in-java\/\" title=\"Linear Search Program in Java\">Linear Search Program in Java<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Menu Driven Programs enhance the interactiveness of the programs. These type of programs takes input from the user and according to the input, shows the output to the user. Here, we will be discussing the Menu Driven Program in Java. Menu Driven Program Menu Driven Program in Java is defined as a program that is [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[143],"tags":[],"class_list":["post-11082","post","type-post","status-publish","format-standard","hentry","category-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Menu Driven Program in Java<\/title>\n<meta name=\"description\" content=\"We will learn how to use the switch-case statements to create a menu-driven program in Java.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Menu Driven Program in Java\" \/>\n<meta property=\"og:description\" content=\"We will learn how to use the switch-case statements to create a menu-driven program in Java.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"PrepBytes Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prepbytes0211\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-19T06:51:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-18T12:29:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg\" \/>\n<meta name=\"author\" content=\"Prepbytes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prepbytes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/\"},\"author\":{\"name\":\"Prepbytes\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\"},\"headline\":\"Menu Driven Program in Java\",\"datePublished\":\"2022-12-19T06:51:14+00:00\",\"dateModified\":\"2023-04-18T12:29:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/\"},\"wordCount\":1158,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/\",\"url\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/\",\"name\":\"Menu Driven Program in Java\",\"isPartOf\":{\"@id\":\"http:\/\/43.205.93.38\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg\",\"datePublished\":\"2022-12-19T06:51:14+00:00\",\"dateModified\":\"2023-04-18T12:29:53+00:00\",\"description\":\"We will learn how to use the switch-case statements to create a menu-driven program in Java.\",\"breadcrumb\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#primaryimage\",\"url\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg\",\"contentUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/43.205.93.38\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\/\/prepbytes.com\/blog\/category\/java\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Menu Driven Program in Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/43.205.93.38\/#website\",\"url\":\"http:\/\/43.205.93.38\/\",\"name\":\"PrepBytes Blog\",\"description\":\"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING\",\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/43.205.93.38\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/43.205.93.38\/#organization\",\"name\":\"Prepbytes\",\"url\":\"http:\/\/43.205.93.38\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"contentUrl\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"width\":160,\"height\":160,\"caption\":\"Prepbytes\"},\"image\":{\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/prepbytes0211\/\",\"https:\/\/www.instagram.com\/prepbytes\/\",\"https:\/\/www.linkedin.com\/company\/prepbytes\/\",\"https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\",\"name\":\"Prepbytes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"caption\":\"Prepbytes\"},\"url\":\"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Menu Driven Program in Java","description":"We will learn how to use the switch-case statements to create a menu-driven program in Java.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Menu Driven Program in Java","og_description":"We will learn how to use the switch-case statements to create a menu-driven program in Java.","og_url":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/","og_site_name":"PrepBytes Blog","article_publisher":"https:\/\/www.facebook.com\/prepbytes0211\/","article_published_time":"2022-12-19T06:51:14+00:00","article_modified_time":"2023-04-18T12:29:53+00:00","og_image":[{"url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg","type":"","width":"","height":""}],"author":"Prepbytes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prepbytes","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#article","isPartOf":{"@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/"},"author":{"name":"Prepbytes","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e"},"headline":"Menu Driven Program in Java","datePublished":"2022-12-19T06:51:14+00:00","dateModified":"2023-04-18T12:29:53+00:00","mainEntityOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/"},"wordCount":1158,"commentCount":0,"publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/","url":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/","name":"Menu Driven Program in Java","isPartOf":{"@id":"http:\/\/43.205.93.38\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#primaryimage"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg","datePublished":"2022-12-19T06:51:14+00:00","dateModified":"2023-04-18T12:29:53+00:00","description":"We will learn how to use the switch-case statements to create a menu-driven program in Java.","breadcrumb":{"@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#primaryimage","url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg","contentUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1671430712143-Menu%20Driven%20Program%20in%20Java.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/prepbytes.com\/blog\/menu-driven-program-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/43.205.93.38\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/prepbytes.com\/blog\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Menu Driven Program in Java"}]},{"@type":"WebSite","@id":"http:\/\/43.205.93.38\/#website","url":"http:\/\/43.205.93.38\/","name":"PrepBytes Blog","description":"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING","publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/43.205.93.38\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/43.205.93.38\/#organization","name":"Prepbytes","url":"http:\/\/43.205.93.38\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/","url":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","contentUrl":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","width":160,"height":160,"caption":"Prepbytes"},"image":{"@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/prepbytes0211\/","https:\/\/www.instagram.com\/prepbytes\/","https:\/\/www.linkedin.com\/company\/prepbytes\/","https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA"]},{"@type":"Person","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e","name":"Prepbytes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","caption":"Prepbytes"},"url":"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/"}]}},"_links":{"self":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/11082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/comments?post=11082"}],"version-history":[{"count":2,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/11082\/revisions"}],"predecessor-version":[{"id":15741,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/11082\/revisions\/15741"}],"wp:attachment":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/media?parent=11082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/categories?post=11082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/tags?post=11082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}