Create an if-else logic to determine the lexicographic


Open a JOptionPane confirm dialog as shown on Figure 1 below. This dialog box is a graphical embodiment of the if-else logic. However, the button clicks of this window return integer values, not a boolean value or String. Follow the template exactly. The syntax is similar to that of the other dialogs:

JOptionPane.showConfirmDialog(null, ,    , JOptionPane.YES_NO_OPTION);</strong></p> <p style="text-align: justify;">Note that a button click makes this method return an <strong>integer number</strong> which is one of the two named constants</p> <p style="text-align: justify;"><strong>JOptionPane.YES_OPTION</strong> or <strong>JOptionPane.NO_OPTION</strong></p> <p style="text-align: justify;">Assign the return value to an integer variable like</p> <p style="text-align: justify;"><strong>int choice = JOptionPane.showConfirmDialog(null,etc)</strong></p> <p style="text-align: justify;">(1pt) Using an if statement like</p> <p style="text-align: justify;"><strong>if(choice</strong> <strong>==</strong> <strong>JOptionPane.NO_OPTION)</strong></p> <p style="text-align: justify;">you check if <strong>choice</strong> is the No option, in that case send the message</p> <p style="text-align: justify;"><strong>The program terminates!</strong></p> <p style="text-align: justify;">to the console and terminate the program with the System.exit(0) statement.</p> <p style="text-align: justify;">Otherwise do as follows:</p> <p style="text-align: justify;">Solicit three names written in a row to a JOptionPane <strong>input window</strong> as shown in</p> <p style="text-align: justify;">Figure 2. Each name must be one word and the words are separated by spaces. Follow the template layout accurately, but you can choose other names. Save the return value in a variable named <strong>names</strong>. Remember, the input window returns a string.</p> <p style="text-align: justify;">Validate the input: <strong>null</strong> string or <strong>empty</strong> string is not accepted for <strong>names.</strong> Use the same <strong>if</strong> logic as in Lab 4, in the if block print the message</p> <p style="text-align: justify;">"Input is not valid, program terminates"</p> <p style="text-align: justify;">to the console and terminate the program.</p> <p style="text-align: justify;">Otherwise do as follows to <strong>learn a new Scanner property</strong>:</p> <p style="text-align: justify;">Declare three String variables <strong>name1, name2</strong> and <strong>name3</strong> to serve as the storage for the individual names from the input</p> <p style="text-align: justify;">Declare and instantiate a Scanner reference <strong>splitter</strong> as in your previous assignments, but this time write in the constructor for parameter the variable <strong>names</strong> (rather than System.in). Here is the code for the instantiation (do not forget to import the util package above the class header):</p> <p style="text-align: justify;"><strong>Scanner splitter = new Scanner(names);</strong></p> <p style="text-align: justify;">Apply the method call <strong>splitter.next( )</strong> three times and save the return values one after each other in the variables <strong>name1,name2</strong> and <strong>name3,</strong> respectively</p> <p style="text-align: justify;">Create an <strong>if-else</strong> logic to determine the lexicographic order of the names. This logic is supposed to be the same as the one you implemented in the incomplete version.</p> <p style="text-align: justify;">For this purpose use the compareTo method of the String class with the 'ignore case' option (see the book p 150); declare and use additional helper variables if needed. There are six possible orders for three names, your selection logic must cover all six of of them.</p> <p style="text-align: justify;">If you did Lab 5 Incomplete, you can use your code solving the book Programming Challenge 7.</p> <p style="text-align: justify;">(1pt) Collect and save the names in correct order in a single String variable <strong>namesOrdered</strong></p> <p style="text-align: justify;">(1pt) Display the variable <strong>namesOrdered</strong> on a message dialog.</p> <p style="text-align: justify;">(1pts) Test your program for each of the 6 possible arrangements of three input words (you may use short words for testing purposes like "Abe" "Bo" "Cy".</p></p> </div> <div id="viewreadmore" class="link"> <a id="readmore" href="javascript:void(0);" class="read-more-trigger mar_top10" onclick="changeheight(this)">View Complete Question</a> </div> <div id="DivRequest"> <h4> Request for Solution File </h4> <div class="seprator"> </div> <div class="downloadfiles"> <h5> Ask an Expert for Answer!!</h5> <h6> Computer Engineering: Create an if-else logic to determine the lexicographic</h6> <h5> Reference No:- TGS02879248</h5> <input type="submit" name="btnGetQuote" value="Request for Solution File" id="btnGetQuote" class="btn btnexperts btn-lg btn-block-sm mar_btm20" /> <p> Expected delivery within 24 Hours</p> </div> </div> </div> <div class="row"> <div class="col-sm-12 reviewbox"> <div class="row "> <div class="panel-group review" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel-heading" role="tab" id="headingTwo"> <h4 class="panel-title"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> Have a Question? (oR Write a Review) </a> </h4> </div> <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo"> <div class="panel-body"> <div class="col-sm-12"> <div class="row search searchbg message"> <span id="RequiredFieldValidator1" style="visibility:hidden;">Write atleast 100 words!!</span> <textarea name="txtcomments" id="txtcomments" maxlength="1000" ValidationGroup="Review" placeholder="Write your review" class="form-control" rows="6"></textarea> <div class="pull-right mar_top20"> <input type="submit" name="btnReviewSubmit" value="Submit" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("btnReviewSubmit", "", true, "Review", "", false, false))" id="btnReviewSubmit" class="btn btn-primary pull-right" /> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="user-comments-area hidden-xs"> <h4 class="text-uppercase mar_btm20"> <i class="fa fa-question-circle"></i>   Recent Questions Asked Computer Engineering</h4> <ul class="user-comments-list"> <table id="dlMaterials" cellspacing="0" style="width:100%;border-collapse:collapse;"> <tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_0" class="studenthdname" href="https://www.tutorsglobe.com/question/compare-harry-potter-to-bilbo-baggins-which-is-the-more-52879244.aspx">Compare harry potter to bilbo baggins which is the more</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_0">try to consider what makes that story mythological or perhaps conversely why you think a particular work does not</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_1" class="studenthdname" href="https://www.tutorsglobe.com/question/itech1400--foundations-of-programming---supermarket-52879245.aspx">Itech1400 foundations of programming - supermarket</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_1">assignment overviewyou are tasked with creating a text-based program for simulating a supermarket self-service checkout</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_2" class="studenthdname" href="https://www.tutorsglobe.com/question/why-do-these-three-commands-return-the-result-they-do-do-52879246.aspx">Why do these three commands return the result they do do</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_2">open a terminal and do the following1 type whoamiq1 what is the result2 type id -unq2 what is the result3 type echo</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_3" class="studenthdname" href="https://www.tutorsglobe.com/question/pat-had-agi-of-300000-in-completing-her-income-tax-return-52879247.aspx">Pat had agi of 300000 in completing her income tax return</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_3">question - pat gave 5000 shares of stock in coyote corporation a publicly traded corporation to her church a qualified</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_4" class="studenthdname" href="https://www.tutorsglobe.com/question/create-an-if-else-logic-to-determine-the-lexicographic-52879248.aspx">Create an if-else logic to determine the lexicographic</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_4">open a joptionpanenbspconfirm dialognbspas shown on figure 1 below this dialog box is a graphical embodiment of the</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_5" class="studenthdname" href="https://www.tutorsglobe.com/question/cindys-share-of-the-llc-s-losses-was-85000-in-2014-and-52879249.aspx">Cindys share of the llc s losses was 85000 in 2014 and</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_5">question - in 2014 cindy invested 100000 for a 25 interest in a limited liability company llc in which she is a</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_6" class="studenthdname" href="https://www.tutorsglobe.com/question/what-are-the-two-models-of-interprocess-communication-what-52879250.aspx">What are the two models of interprocess communication what</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_6">in opreating system write from your wordsq 1 what are the two models of interprocess communication what are the</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_7" class="studenthdname" href="https://www.tutorsglobe.com/question/open-the-file-testblooddatajava-and-click-the-run-code-52879251.aspx">Open the file testblooddatajava and click the run code</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_7">open the file blooddatajava that includes fields that hold a blood type the four blood types are o a b and ab and an rh</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <span class="mar_lft5">Q :</span> <a id="dlMaterials_hypermaterial_8" class="studenthdname" href="https://www.tutorsglobe.com/question/what-amount-if-any-of-the-proceeds-from-the-issuance-should-52879252.aspx">What amount if any of the proceeds from the issuance should</a></h5> <p class="answer"> <span id="dlMaterials_lblQuestion_8">question - during 2010 gordon company issued at 104 three hundred 1000 bonds due in ten years one detachable stock</span></p> </div> <!-- /comment-box --> </li> </td> </tr> </table> </ul> <!-- /user-comments-list --> </div> </div> <div class="col-md-4 col-xs-12 login-area innerpage"> <div class="row"> <div class="details col-md-12"> <div class="col-md-4"> <div class="circle orange"> <i class="fa fa-question"></i> </div> <p> 1924132 </p> <p> Questions<br /> Asked</p> </div> <div class="col-md-4"> <div class="circle yellow"> <i class="fa fa-user-secret"></i> </div> <p> 3,689</p> <p> Active Tutors</p> </div> <div class="col-md-4"> <div class="circle green"> <i class="fa fa-thumbs-o-up"></i> </div> <p> 1436393</p> <p> Questions<br /> Answered</p> </div> <p><b> Start Excelling in your courses, Ask a tutor for help and get answers for your problems !! </b></p> <a href="https://www.tutorsglobe.com/post-your-job-for-free.aspx" class="btn btn-primary btn-lg mar_top10">ask Question</a> </div> </div> <div class="row"> <div class="user-comments-area hidden-xs"> <hr /> <h4 class="text-uppercase mar_btm20"> <i class="fa fa-question-circle"></i> Asked Questions</h4> <hr /> <ul class="user-comments-list"> <table id="dlNewReviews" cellspacing="0" style="width:100%;border-collapse:collapse;"> <tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_0" class="studenthdname" href="https://www.tutorsglobe.com/question/compare-critical-feminist-theory-and-power-control-theory-53424595.aspx">Compare critical feminist theory and power-control theory</a></h5> <p> <span id="dlNewReviews_lblReviews_0"> Compose a paper that compares and contrasts critical feminist theory and power-control theory as forms of gendered criminology. Your paper should:</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_1" class="studenthdname" href="https://www.tutorsglobe.com/question/which-are-forms-of-media-bias-53424596.aspx">Which are forms of media bias</a></h5> <p> <span id="dlNewReviews_lblReviews_1">Question: Which of the following are forms of media bias? (Select all that apply)</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_2" class="studenthdname" href="https://www.tutorsglobe.com/question/what-is-meant-by-indigenismo-53424610.aspx">What is meant by indigenismo</a></h5> <p> <span id="dlNewReviews_lblReviews_2">Question: What is meant by indigenismo (Keywords in Week 2)? What is las cronicas de castas (Cope)?</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_3" class="studenthdname" href="https://www.tutorsglobe.com/question/how-are-schools-important-in-the-struggle-for-power-53424600.aspx">How are schools important in the struggle for power</a></h5> <p> <span id="dlNewReviews_lblReviews_3">Question: How are schools important in the struggle for power and status? </span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_4" class="studenthdname" href="https://www.tutorsglobe.com/question/what-when-people-get-involved-in-community-and-social-change-53424597.aspx">What when people get involved in community and social change</a></h5> <p> <span id="dlNewReviews_lblReviews_4">When people get involved in community and social change but do not hold official political positions, which of the terms best describes what they are part of</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_5" class="studenthdname" href="https://www.tutorsglobe.com/question/which-of-the-things-happened-first-53424587.aspx">Which of the things happened first</a></h5> <p> <span id="dlNewReviews_lblReviews_5">Which of the following things happened first? Group of answer choices Women gained the right to vote Seneca Falls Convention Margaret</span></p> </div> <!-- /comment-box --> </li> </td> </tr><tr> <td> <li> <div class="comment-box"> <h5> <a id="dlNewReviews_hyperQues_6" class="studenthdname" href="https://www.tutorsglobe.com/question/why-does-victor-coin-the-term-hyper-violence-53424598.aspx">Why does victor coin the term hyper-violence</a></h5> <p> <span id="dlNewReviews_lblReviews_6">Why does victor coin the term hyper-violence instead of just using violence? And second, how is hyper-violence display in the Oakland community?</span></p> </div> <!-- /comment-box --> </li> </td> </tr> </table> </ul> </div> </div> </div> </div> </div> </div> </div> <script> var url = 'https://www.tutorsglobe.com/include/javascript/watiWidget.js'; var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url; var options = { "enabled":true, "chatButtonSetting":{ "backgroundColor":"#00e785", "ctaText":"Whatsapp Support!!", "borderRadius":"25", "marginLeft": "0", "marginRight": "20", "marginBottom": "20", "ctaIconWATI":false, "position":"left" }, "brandSetting":{ "brandName":"Tutorsglobe", "brandSubTitle":"Trusted Since 2005", "brandImg":"https://www.tutorsglobe.com/include/images/chat-logo.svg", "welcomeText":"Hi there!\nDo you Need help?", "messageText":"Hello, Tutorsglobe !! I have a question!", "backgroundColor":"#00e785", "ctaText":"Chat with Whatsapp", "borderRadius":"25", "autoShow":false, "phoneNumber":"441416286080" } }; s.onload = function() { CreateWhatsappChatWidget(options); }; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); </script> <footer class="site-footer"> <div class="container"> <div class="footerlinks"> <a href="https://www.tutorsglobe.com/">Home</a> | <a href="https://www.tutorsglobe.com/about-us.aspx">Company Overview</a> | <a href="https://www.tutorsglobe.com/services.aspx">Services</a> | <a href="https://www.tutorsglobe.com/library/">Discover Q&A</a> | <a href="https://www.tutorsglobe.com/sitemap.aspx">Sitemap</a> | <a href="https://www.tutorsglobe.com/contact-us.aspx">Contact Us</a> | <a href="https://www.tutorsglobe.com/terms-and-conditions.aspx">T & C</a> | <a href="https://www.tutorsglobe.com/refundcancelpolicy.aspx">Refund Policy</a> | <a href="https://www.tutorsglobe.com/copyright-infringement-policy.aspx">Copyright Policy</a> | <a href="https://www.tutorsglobe.com/blog/archive/">Blog</a> | <a href="https://www.tutorsglobe.com/library/archive.aspx">Q&A</a> | <a href="https://www.tutorsglobe.com/education-directory.aspx">Directory</a> </div> <p>©TutorsGlobe</a> All rights reserved 2022-2023. </p> <script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "product", "name": "Tutorsglobe", "image": "https://www.tutorsglobe.com/IncludeLib/Images/logo.png", "description": "elearning Platform - Tutor Service", "brand": { "@type": "elearning", "name": "Tutorsglobe" }, "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.9", "ratingCount": "37128" } } </script> <a href="#" class="settings"><i class="fa fa-angle-up"></i></a> <ul class="social-icons"> <li><a href="https://www.facebook.com/TutorsGlobe" rel="nofollow" target="_blank"><i class="fa fa-facebook-square"></i></a></li> <li><a href="https://twitter.com/Tutorsglobe" rel="nofollow" target="_blank"><i class="fa fa-twitter-square"></i></a></li> <li><a href="#" rel="nofollow"><i class="fa fa-youtube-square"></i></a></li> <li><a href="https://www.linkedin.com/company/tutorsglobe" target="_blank" rel="nofollow"><i class="fa fa-linkedin-square"></i></a></li> </ul> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-32333066-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.tutorsglobe.com/IncludeLib/js/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-5E9QFMFDJR"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-5E9QFMFDJR'); </script> </footer> </div> <!-- /pageWrap --> <div class="overlay"> </div> <!-- JavaScript Files ================================================== --> <script type="text/javascript" src="../IncludeLib/js/jquery-1.11.2.min.js"></script> <script type="text/javascript" src="../IncludeLib/js/bootstrap.min.js"></script> <script type="text/javascript" src="../IncludeLib/js/jquery.mCustomScrollbar.concat.min.js"></script> <script type="text/javascript" src="../IncludeLib/js/script.js"></script> <script type="text/javascript" src="../IncludeLib/js/ie10-viewport-bug-workaround.js"></script> <script type="text/javascript"> //<![CDATA[ var Page_Validators = new Array(document.getElementById("RequiredFieldValidator1")); //]]> </script> <script type="text/javascript"> //<![CDATA[ var RequiredFieldValidator1 = document.all ? document.all["RequiredFieldValidator1"] : document.getElementById("RequiredFieldValidator1"); RequiredFieldValidator1.controltovalidate = "txtcomments"; RequiredFieldValidator1.errormessage = "Write atleast 100 words!!"; RequiredFieldValidator1.validationGroup = "Review"; RequiredFieldValidator1.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid"; RequiredFieldValidator1.initialvalue = ""; //]]> </script> <script type="text/javascript"> //<![CDATA[ var Page_ValidationActive = false; if (typeof(ValidatorOnLoad) == "function") { ValidatorOnLoad(); } function ValidatorOnSubmit() { if (Page_ValidationActive) { return ValidatorCommonOnSubmit(); } else { return true; } } //]]> </script> </form> </body> </html>