<spanclass="comment"> * Click </span><spanclass="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><spanclass="comment"> to change this license</span>
<spanclass="comment"> * Click </span><spanclass="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><spanclass="comment"> to edit this template</span>
System.<spanclass="ST2">out</span>.println(<spanclass="string">"</span><spanclass="string">Please enter y/n or yes/no: </span><spanclass="string">"</span>);
<spanclass="literal">if</span> (userResponse.length() ><spanclass="number">1</span>) { <spanclass="comment">// User has entered a string that starts with y</span>
<spanclass="comment">// Check if string == yes</span>
<spanclass="literal">if</span> (userResponse.length() ><spanclass="number">1</span>) { <spanclass="comment">// User has entered a string that starts with y</span>
<spanclass="comment">// Check if string == yes</span>
<spanclass="comment">// If it got past this, the user entered a number.</span>
System.<spanclass="ST2">out</span>.println(<spanclass="string">"</span><spanclass="string">Invalid input! You entered </span><spanclass="string">"</span> + parseCheck + <spanclass="string">"</span><spanclass="string">, which is an integer!</span><spanclass="string">"</span>);
<spanclass="literal">if</span> (!(userResponse.length() ><spanclass="number">1</span>)) { <spanclass="comment">// Condition is true if response is a char.</span>
System.<spanclass="ST2">out</span>.println(<spanclass="string">"</span><spanclass="string">'</span><spanclass="string">"</span> + userResponse + <spanclass="string">"</span><spanclass="string">' is an incorrect character!</span><spanclass="string">"</span>);
} <spanclass="literal">else</span> { <spanclass="comment">// Response is a string.</span>
System.<spanclass="ST2">out</span>.println(<spanclass="string">"</span><spanclass="string">'</span><spanclass="string">"</span> + userResponse + <spanclass="string">"</span><spanclass="string">' is too long!</span><spanclass="string">"</span>);